CREATE TABLE recorded_videos (
    id BIGINT PRIMARY KEY,
    user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE,
    fully_uploaded BOOLEAN NOT NULL DEFAULT FALSE,
    recording_id VARCHAR(64) NOT NULL,
    length  BIGINT,
    client_video_source_id VARCHAR(64) NOT NULL,
    url VARCHAR(1024),
    file_offset BIGINT,
    upload_failures INTEGER NOT NULL DEFAULT 0,
    discard BOOLEAN,

    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

ALTER TABLE recorded_videos ALTER COLUMN id SET DEFAULT nextval('tracks_next_tracker_seq');
