1
0
forked from poc/pds

Masters and Transaction table column type update CITEXT

This commit is contained in:
dhanabalan
2025-03-24 19:47:34 +05:30
parent c631f1f2c0
commit 8612cc08b1
4 changed files with 11 additions and 10 deletions

View File

@@ -19,8 +19,8 @@ return new class extends Migration
block_id BIGINT NOT NULL, block_id BIGINT NOT NULL,
plant_id BIGINT NOT NULL, plant_id BIGINT NOT NULL,
code TEXT NOT NULL, code CITEXT NOT NULL,
reason TEXT NOT NULL, reason CITEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(), created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(),

View File

@@ -18,8 +18,8 @@ return new class extends Migration
block_id BIGINT NOT NULL, block_id BIGINT NOT NULL,
plant_id BIGINT NOT NULL, plant_id BIGINT NOT NULL,
name TEXT NOT NULL, name CITEXT NOT NULL,
type TEXT NOT NULL, type CITEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(), created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(),

View File

@@ -19,8 +19,7 @@ return new class extends Migration
block_id BIGINT NOT NULL, block_id BIGINT NOT NULL,
plant_id BIGINT NOT NULL, plant_id BIGINT NOT NULL,
code_id BIGINT NOT NULL, code_id BIGINT NOT NULL,
reason_id BIGINT NOT NULL,
reason TEXT NOT NULL,
from_datetime TIMESTAMP NOT NULL, from_datetime TIMESTAMP NOT NULL,
to_datetime TIMESTAMP NOT NULL, to_datetime TIMESTAMP NOT NULL,
@@ -35,7 +34,8 @@ return new class extends Migration
FOREIGN KEY (shift_id) REFERENCES shifts (id), FOREIGN KEY (shift_id) REFERENCES shifts (id),
FOREIGN KEY (block_id) REFERENCES blocks (id), FOREIGN KEY (block_id) REFERENCES blocks (id),
FOREIGN KEY (plant_id) REFERENCES plants (id), FOREIGN KEY (plant_id) REFERENCES plants (id),
FOREIGN KEY (code_id) REFERENCES line_stops (id) FOREIGN KEY (code_id) REFERENCES line_stops (id),
FOREIGN KEY (reason_id) REFERENCES line_stops (id)
); );
SQL; SQL;

View File

@@ -19,15 +19,16 @@ return new class extends Migration
shift_id BIGINT NOT NULL, shift_id BIGINT NOT NULL,
block_id BIGINT NOT NULL, block_id BIGINT NOT NULL,
plant_id BIGINT NOT NULL, plant_id BIGINT NOT NULL,
item_id BIGINT NOT NULL,
item_code TEXT NOT NULL, serial_number CITEXT NOT NULL UNIQUE,
serial_number TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(), created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP, deleted_at TIMESTAMP,
UNIQUE (item_code, serial_number), UNIQUE (item_id, serial_number),
FOREIGN KEY (item_id) REFERENCES items (id),
FOREIGN KEY (line_id) REFERENCES lines (id), FOREIGN KEY (line_id) REFERENCES lines (id),
FOREIGN KEY (shift_id) REFERENCES shifts (id), FOREIGN KEY (shift_id) REFERENCES shifts (id),
FOREIGN KEY (block_id) REFERENCES blocks (id), FOREIGN KEY (block_id) REFERENCES blocks (id),