dblayeroo : get the foreignUsed fields and tables

dblayeroo : get the primary key for PostgreSQL


git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5038 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2019-02-15 08:03:10 +00:00
parent b14879d59c
commit 673b8ec609
2 changed files with 146 additions and 29 deletions

View File

@@ -380,17 +380,45 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
$res = $tbl3->getTableSchema ("usersoo");
$tbl3->disconnect ();
$this->assertSame (
array ("fields"=>array (
"uid"=>array ("integer", "not null", "autoincrement"),
"gecos"=>array ("varchar(255)", "not null"),
"password"=>array ("varchar(255)", "not null"),
array ("table" => "usersoo",
"fields" => array (
"uid" => array ("integer", "not null", "autoincrement"),
"gecos" => array ("varchar(255)", "not null"),
"password" => array ("varchar(255)", "not null"),
"group" => array ("varchar(255)", "not null"),
),
"primary"=>"uid",
"unique"=>array ("gecos","password"),
"primary" => "uid",
"unique" => array ("gecos","password","uid"),
"foreign" => array (
"group" => array ('groupedoo', 'group', 'ON DELETE CASCADE'),
),
"foreignUsed" => array (
),
), $res);
}
public function test_getTableSchema2 ()
{
$tbl3 = $this->tbl3 ();
$res = $tbl3->getTableSchema ("groupedoo");
$tbl3->disconnect ();
$this->assertSame (
array (
"table" => "groupedoo",
"fields" => array (
"group" => array ("varchar(255)", "not null"),
"object" => array ("varchar(255)", "not null"),
"where" => array ("varchar(255)", "not null"),
"with space" => array ("varchar(255)")),
"primary" => "group",
"unique" => array ("group"),
"foreign" => array (),
"foreignUsed" => array (
"group" => array (
array ("rightsoo", "group"),
array ("usersoo", "group"),
),
),
), $res);
}