mirror of
https://github.com/Example-uPagge/spring-boot-one-to-many.git
synced 2024-06-14 11:22:31 +03:00
14 lines
323 B
SQL
14 lines
323 B
SQL
CREATE TABLE status
|
|
(
|
|
id BIGINT NOT NULL PRIMARY KEY,
|
|
title VARCHAR(30) NOT NULL UNIQUE
|
|
);
|
|
|
|
CREATE TABLE post
|
|
(
|
|
id BIGINT NOT NULL PRIMARY KEY,
|
|
title VARCHAR(60),
|
|
status VARCHAR(30) NOT NULL
|
|
CONSTRAINT fk_post_status_status_title
|
|
REFERENCES status(title) ON UPDATE CASCADE
|
|
); |