Merge branch 'master' of ssh://172.31.31.31:2222/poc/pds
This commit is contained in:
@@ -14,9 +14,9 @@ return new class extends Migration
|
||||
CREATE TABLE plants (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
|
||||
code INT NOT NULL CHECK (code >= 1000) UNIQUE,
|
||||
company_id BIGINT NOT NULL,
|
||||
|
||||
code INT NOT NULL CHECK (code >= 1000) UNIQUE,
|
||||
name TEXT NOT NULL UNIQUE, -- CITEXT use extension
|
||||
address TEXT NOT NULL,
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ return new class extends Migration
|
||||
CREATE TABLE blocks (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
|
||||
name TEXT NOT NULL,
|
||||
plant_id BIGINT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
|
||||
@@ -18,8 +18,7 @@ return new class extends Migration
|
||||
shift_id BIGINT NOT NULL,
|
||||
block_id BIGINT NOT NULL,
|
||||
plant_id BIGINT NOT NULL,
|
||||
code_id BIGINT NOT NULL,
|
||||
reason_id BIGINT NOT NULL,
|
||||
lineStop_id BIGINT NOT NULL,
|
||||
|
||||
from_datetime TIMESTAMP NOT NULL,
|
||||
to_datetime TIMESTAMP NOT NULL,
|
||||
@@ -34,8 +33,7 @@ return new class extends Migration
|
||||
FOREIGN KEY (shift_id) REFERENCES shifts (id),
|
||||
FOREIGN KEY (block_id) REFERENCES blocks (id),
|
||||
FOREIGN KEY (plant_id) REFERENCES plants (id),
|
||||
FOREIGN KEY (code_id) REFERENCES line_stops (id),
|
||||
FOREIGN KEY (reason_id) REFERENCES line_stops (id)
|
||||
FOREIGN KEY (lineStop_id) REFERENCES line_stops (id)
|
||||
);
|
||||
SQL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user