ALTER TABLE DOC_GROUPS ADD COLUMN locked INT;
ALTER TABLE DOC_GROUPS ALTER COLUMN locked SET DEFAULT 0;
UPDATE DOC_GROUPS SET locked = 0;
ALTER TABLE DOC_GROUPS ADD COLUMN locked_by INT;
ALTER TABLE DOC_GROUPS ADD COLUMN lockdate INT;
ALTER TABLE DOC_GROUPS ALTER COLUMN lockdate SET DEFAULT 0;
ALTER TABLE DOC_GROUPS ADD FOREIGN KEY (locked_by) REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE;
