1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php
$result[] = tableCreate('passthrough_group', "
`groupid` varchar(32) CHARACTER SET ascii DEFAULT NULL,
`title` varchar(200) NOT NULL,
PRIMARY KEY (`groupid`)
");
$result[] = tableCreate('passthrough_group_x_location', "
`groupid` varchar(32) CHARACTER SET ascii DEFAULT NULL,
`locationid` INT(11) NOT NULL,
PRIMARY KEY (`groupid`, `locationid`)
");
$result[] = tableAddConstraint('passthrough_group_x_location', 'groupid',
'passthrough_group', 'groupid',
'ON DELETE CASCADE ON UPDATE CASCADE');
$result[] = tableAddConstraint('passthrough_group_x_location', 'locationid',
'location', 'locationid',
'ON DELETE CASCADE ON UPDATE CASCADE');
responseFromArray($result);
|