CREATE TABLE storages
(
    n SERIAL NOT NULL,
	id VARCHAR(50),
	folder_id VARCHAR(50),
    bucket VARCHAR(50),
    created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL,
	name VARCHAR,
	description VARCHAR,
	labels HSTORE,
    CONSTRAINT storages_pkey PRIMARY KEY (n),
    CONSTRAINT storages_id_key UNIQUE (id)
);

ALTER TABLE ammos
    ADD storage_id VARCHAR(50);

ALTER TABLE ammos
    ADD CONSTRAINT storage_id_fkey
        FOREIGN KEY (storage_id)
            REFERENCES storages (id)
            ON DELETE SET NULL;

ALTER TABLE operations
    ADD foreign_operation_id VARCHAR(50);

