1 |
CREATE TABLE car_additional_device ( id SERIAL NOT NULL, datetime_begin TIMESTAMP WITH TIME ZONE NOT NULL, mounter_id BIGINT, device_id BIGINT NOT NULL, car_id BIGINT NOT NULL, deleted BOOLEAN NOT NULL SET DEFAULT FALSE, created_at TIMESTAMP WITH TIME ZONE SET DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), FOREIGN KEY (car_id) REFERENCES car(id), FOREIGN KEY (device_id) REFERENCES device(id), FOREIGN KEY (mounter_id) REFERENCES organization(id) ); ALTER TABLE cad ADD COLUMN purpose VARCHAR(100) DEFAULT 'не определен' NOT NULL; ALTER TABLE cad DROP COLUMN purpose; ALTER TABLE cad ADD COLUMN is_additional BOOLEAN DEFAULT FALSE; |
Комментарии