-- basic information of bay

-- DROP TABLE IF EXISTS PUBLIC.BAY;

CREATE TABLE PUBLIC.BAY (
    ID SERIAL PRIMARY KEY,
  	NAME VARCHAR(64) NOT NULL DEFAULT '',
  	TYPE VARCHAR(64) NOT NULL DEFAULT '',
    GRID VARCHAR(64) NOT NULL DEFAULT '',
    ZONE VARCHAR(64) NOT NULL DEFAULT '',
    STATION VARCHAR(64) NOT NULL DEFAULT '',
  	FROM_NODE JSONB NOT NULL DEFAULT '[]', -- uuids
  	TO_NODE JSONB NOT NULL DEFAULT '[]', -- uuids
	OP INTEGER NOT NULL DEFAULT -1,
    TS TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP 
);