create table workspaces (
    id BIGINT PRIMARY KEY,
    organization_id BIGINT NOT NULL,
    name TEXT NOT NULL
);

CREATE TABLE tags (
    id BIGINT PRIMARY KEY,
    name TEXT NOT NULL,
    workspace_id BIGINT NOT NULL,
    creator_id BIGINT NOT NULL,
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
    deleted_at TIMESTAMP WITH TIME ZONE,
    permissions TEXT
);

CREATE TABLE projects (
    id BIGINT PRIMARY KEY,
    workspace_id BIGINT NOT NULL,
    client_id BIGINT,
    name TEXT NOT NULL,
    color TEXT NOT NULL,
    status TEXT NOT NULL,
    active BOOLEAN NOT NULL,
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
    start_date DATE NOT NULL,
    created_at TIMESTAMP WITH TIME ZONE NOT NULL,
    server_deleted_at TIMESTAMP WITH TIME ZONE,
    actual_hours BIGINT,
    actual_seconds BIGINT,
    can_track_time BOOLEAN NOT NULL,
    permissions TEXT
);

CREATE TABLE tracking_clients (
    id BIGINT PRIMARY KEY,
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
    archived BOOLEAN NOT NULL,
    creator_id BIGINT NOT NULL,
    integration_provider TEXT,
    notes TEXT,
    name TEXT NOT NULL,
    server_deleted_at TIMESTAMP WITH TIME ZONE,
    workspace_id BIGINT NOT NULL,
    permissions TEXT
);
