|
Posted by J.O. Aho on 06/20/06 16:48
Frankly wrote:
> its just about 3am here. I was having a hard time sleeping so i figured i
> would give this another shot.
>
> CREATE DATABASE `myweb325573_grace`;
This creates the database itself, you don't need this at this moment, as it's
already created.
> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
This removes the table RelationManagementsBuildings, if it already exists in
the database.
> CREATE TABLE `RelationManagementsBuildings` (
>
> `ManID` int(10) unsigned NOT NULL default '0',
>
> `BuildingID` int(10) unsigned NOT NULL default '0',
>
> PRIMARY KEY (`ManID`,`BuildingID`),
This seems okey.
> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
Haven't used Constraints and cascades, I guess I should read on them, but the
part here you could drop without it affecting the main functionality of the
table, if you remove this, don't forget to remove the comma after the
definition of the primary keys.
Haven't slept much myself tonight, so I will be off early today.
//Aho
[Back to original message]
|