DROP INDEX IF EXISTS jobs_tenant_id_idx;
ALTER TABLE jobs DROP CONSTRAINT IF EXISTS jobs_tenant_id_fkey;
ALTER TABLE jobs DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS refresh_tokens_tenant_id_idx;
ALTER TABLE refresh_tokens DROP CONSTRAINT IF EXISTS refresh_tokens_tenant_id_fkey;
ALTER TABLE refresh_tokens DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS users_tenant_id_idx;
ALTER TABLE users DROP CONSTRAINT IF EXISTS users_tenant_id_fkey;
ALTER TABLE users DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS folders_tenant_id_idx;
ALTER TABLE folders DROP CONSTRAINT IF EXISTS folders_tenant_id_fkey;
ALTER TABLE folders DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS tags_tenant_id_idx;
ALTER TABLE tags DROP CONSTRAINT IF EXISTS tags_tenant_id_fkey;
ALTER TABLE tags DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS correspondents_tenant_id_idx;
ALTER TABLE correspondents DROP CONSTRAINT IF EXISTS correspondents_tenant_id_fkey;
ALTER TABLE correspondents DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS document_correspondents_tenant_id_idx;
ALTER TABLE document_correspondents DROP CONSTRAINT IF EXISTS document_correspondents_tenant_id_fkey;
ALTER TABLE document_correspondents DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS document_tags_tenant_id_idx;
ALTER TABLE document_tags DROP CONSTRAINT IF EXISTS document_tags_tenant_id_fkey;
ALTER TABLE document_tags DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS document_asset_objects_tenant_id_idx;
ALTER TABLE document_asset_objects DROP CONSTRAINT IF EXISTS document_asset_objects_tenant_id_fkey;
ALTER TABLE document_asset_objects DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS document_assets_tenant_id_idx;
ALTER TABLE document_assets DROP CONSTRAINT IF EXISTS document_assets_tenant_id_fkey;
ALTER TABLE document_assets DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS document_versions_tenant_id_idx;
ALTER TABLE document_versions DROP CONSTRAINT IF EXISTS document_versions_tenant_id_fkey;
ALTER TABLE document_versions DROP COLUMN IF EXISTS tenant_id;

DROP INDEX IF EXISTS documents_tenant_id_idx;
ALTER TABLE documents DROP CONSTRAINT IF EXISTS documents_tenant_id_fkey;
ALTER TABLE documents DROP COLUMN IF EXISTS tenant_id;
