mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:55:49 +00:00
Changes by som
This commit is contained in:
parent
d37fba0dfc
commit
feb5faad6a
3 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ CREATE TABLE pets (
|
||||||
type_id INTEGER NOT NULL,
|
type_id INTEGER NOT NULL,
|
||||||
owner_id INTEGER
|
owner_id INTEGER
|
||||||
);
|
);
|
||||||
ALTER TABLE pets ADD CONSTRAINT fk_pets_owners FOREIGN KEY (owner_id) REFERENCES owners (id);
|
ALTER TABLE pets ADD CONSTRAINT fk_pets_owners FOREIGN KEY (owner_id) REFERENCES owners (id) ON DELETE CASCADE;
|
||||||
ALTER TABLE pets ADD CONSTRAINT fk_pets_types FOREIGN KEY (type_id) REFERENCES types (id);
|
ALTER TABLE pets ADD CONSTRAINT fk_pets_types FOREIGN KEY (type_id) REFERENCES types (id);
|
||||||
CREATE INDEX pets_name ON pets (name);
|
CREATE INDEX pets_name ON pets (name);
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ CREATE TABLE pets (
|
||||||
type_id INTEGER NOT NULL,
|
type_id INTEGER NOT NULL,
|
||||||
owner_id INTEGER
|
owner_id INTEGER
|
||||||
);
|
);
|
||||||
ALTER TABLE pets ADD CONSTRAINT fk_pets_owners FOREIGN KEY (owner_id) REFERENCES owners (id);
|
ALTER TABLE pets ADD CONSTRAINT fk_pets_owners FOREIGN KEY (owner_id) REFERENCES owners (id) ON DELETE CASCADE;
|
||||||
ALTER TABLE pets ADD CONSTRAINT fk_pets_types FOREIGN KEY (type_id) REFERENCES types (id);
|
ALTER TABLE pets ADD CONSTRAINT fk_pets_types FOREIGN KEY (type_id) REFERENCES types (id);
|
||||||
CREATE INDEX pets_name ON pets (name);
|
CREATE INDEX pets_name ON pets (name);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS pets (
|
||||||
type_id INT(4) UNSIGNED NOT NULL,
|
type_id INT(4) UNSIGNED NOT NULL,
|
||||||
owner_id INT(4) UNSIGNED,
|
owner_id INT(4) UNSIGNED,
|
||||||
INDEX(name),
|
INDEX(name),
|
||||||
FOREIGN KEY (owner_id) REFERENCES owners(id),
|
FOREIGN KEY (owner_id) REFERENCES owners (id) ON DELETE CASCADE,
|
||||||
FOREIGN KEY (type_id) REFERENCES types(id)
|
FOREIGN KEY (type_id) REFERENCES types(id)
|
||||||
) engine=InnoDB;
|
) engine=InnoDB;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue