-- futures 0001_initial -- -- Create model FuturesDriversSets -- CREATE TABLE "futures_drivers_sets" ("driver_set_id" uuid NOT NULL PRIMARY KEY, "driver_set_status" varchar(50) NOT NULL, "created_on" timestamp with time zone NOT NULL); -- -- Create model FuturesProjects -- CREATE TABLE "futures_projects" ("project_id" uuid NOT NULL PRIMARY KEY, "domain" varchar(255) NULL, "client" varchar(255) NULL, "geography" varchar(255) NULL, "horizon" varchar(255) NULL, "questions" varchar(1024) NULL, "created_on" timestamp with time zone NOT NULL, "is_public" boolean NOT NULL); -- -- Create model FuturesDrivers -- CREATE TABLE "futures_drivers" ("driver_id" uuid NOT NULL PRIMARY KEY, "driver_number" integer NOT NULL, "driver_name" varchar(255) NOT NULL, "driver_description" varchar(1024) NULL, "weight_past" double precision NULL, "push_present" double precision NULL, "pull_future" double precision NULL, "last_modified" timestamp with time zone NOT NULL, "driver_set_id" uuid NOT NULL, "project_id" uuid NOT NULL); -- -- Add field project to futuresdriverssets -- ALTER TABLE "futures_drivers_sets" ADD COLUMN "project_id" uuid NOT NULL CONSTRAINT "futures_drivers_sets_project_id_6a81e448_fk_futures_p" REFERENCES "futures_projects"("project_id") DEFERRABLE INITIALLY DEFERRED; -- -- Create model FuturesDomainCategories -- CREATE TABLE "futures_domain_categories" ("category_id" uuid NOT NULL PRIMARY KEY, "category_name" varchar(100) NOT NULL, "category_path" varchar(255) NOT NULL, "parent_id" uuid NULL, "project_id" uuid NOT NULL); -- -- Create model FuturesScenarioSets -- CREATE TABLE "futures_scenario_sets" ("scenario_set_id" uuid NOT NULL PRIMARY KEY, "scenario_set_status" varchar(50) NOT NULL, "created_on" timestamp with time zone NOT NULL, "scenario_methodology" varchar(255) NULL, "driver_set_id" uuid NOT NULL, "project_id" uuid NOT NULL); -- -- Create model FuturesScenarios -- CREATE TABLE "futures_scenarios" ("scenario_id" uuid NOT NULL PRIMARY KEY, "scenario_logics" varchar(1024) NULL, "scenario_text" text NULL, "last_modified" timestamp with time zone NOT NULL, "scenario_title" varchar(255) NULL, "project_id" uuid NOT NULL, "scenario_set_id" uuid NOT NULL); -- -- Create model FuturesSignals -- CREATE TABLE "futures_signals" ("signal_id" uuid NOT NULL PRIMARY KEY, "title" varchar(255) NULL, "author" varchar(255) NULL, "source_name" varchar(255) NULL, "url" varchar(500) NULL, "signal_date" date NULL, "steep" varchar(50) NULL, "horizon" varchar(50) NULL, "keywords" jsonb NULL, "signal_type" varchar(50) NULL, "description" varchar(1024) NULL, "change_desc" varchar(1024) NULL, "impact" integer NULL, "likelihood" integer NULL, "credibility" integer NULL, "novelty" integer NULL, "created_on" timestamp with time zone NOT NULL, "project_id" uuid NULL); -- -- Create model FuturesStakeholders -- CREATE TABLE "futures_stakeholders" ("stakeholder_id" uuid NOT NULL PRIMARY KEY, "stakeholder_name" varchar(255) NOT NULL, "project_id" uuid NOT NULL); -- -- Create model FuturesScenarioDrivers -- CREATE TABLE "futures_scenario_drivers" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "driver_value" varchar(1024) NULL, "last_modified" timestamp with time zone NOT NULL, "driver_id" uuid NOT NULL, "project_id" uuid NOT NULL, "scenario_id" uuid NOT NULL, CONSTRAINT "unique_scenario_driver" UNIQUE ("scenario_id", "driver_id")); -- -- Create model FuturesDriverSignals -- CREATE TABLE "futures_driver_signals" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "short_description" varchar(1024) NULL, "created_on" timestamp with time zone NOT NULL, "driver_id" uuid NOT NULL, "project_id" uuid NOT NULL, "signal_id" uuid NOT NULL, CONSTRAINT "unique_driver_signal" UNIQUE ("driver_id", "signal_id")); ALTER TABLE "futures_drivers" ADD CONSTRAINT "futures_drivers_driver_set_id_3c27ebca_fk_futures_d" FOREIGN KEY ("driver_set_id") REFERENCES "futures_drivers_sets" ("driver_set_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_drivers" ADD CONSTRAINT "futures_drivers_project_id_024f1f05_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_drivers_driver_set_id_3c27ebca" ON "futures_drivers" ("driver_set_id"); CREATE INDEX "futures_drivers_project_id_024f1f05" ON "futures_drivers" ("project_id"); CREATE INDEX "futures_drivers_sets_project_id_6a81e448" ON "futures_drivers_sets" ("project_id"); ALTER TABLE "futures_domain_categories" ADD CONSTRAINT "futures_domain_categ_parent_id_b8f8187a_fk_futures_d" FOREIGN KEY ("parent_id") REFERENCES "futures_domain_categories" ("category_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_domain_categories" ADD CONSTRAINT "futures_domain_categ_project_id_1295f32b_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_domain_categories_parent_id_b8f8187a" ON "futures_domain_categories" ("parent_id"); CREATE INDEX "futures_domain_categories_project_id_1295f32b" ON "futures_domain_categories" ("project_id"); ALTER TABLE "futures_scenario_sets" ADD CONSTRAINT "futures_scenario_set_driver_set_id_be5ebe3a_fk_futures_d" FOREIGN KEY ("driver_set_id") REFERENCES "futures_drivers_sets" ("driver_set_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_scenario_sets" ADD CONSTRAINT "futures_scenario_set_project_id_652db9c0_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_scenario_sets_driver_set_id_be5ebe3a" ON "futures_scenario_sets" ("driver_set_id"); CREATE INDEX "futures_scenario_sets_project_id_652db9c0" ON "futures_scenario_sets" ("project_id"); ALTER TABLE "futures_scenarios" ADD CONSTRAINT "futures_scenarios_project_id_75bbc6ab_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_scenarios" ADD CONSTRAINT "futures_scenarios_scenario_set_id_4022984b_fk_futures_s" FOREIGN KEY ("scenario_set_id") REFERENCES "futures_scenario_sets" ("scenario_set_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_scenarios_project_id_75bbc6ab" ON "futures_scenarios" ("project_id"); CREATE INDEX "futures_scenarios_scenario_set_id_4022984b" ON "futures_scenarios" ("scenario_set_id"); ALTER TABLE "futures_signals" ADD CONSTRAINT "futures_signals_project_id_3188838c_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_signals_project_id_3188838c" ON "futures_signals" ("project_id"); ALTER TABLE "futures_stakeholders" ADD CONSTRAINT "futures_stakeholders_project_id_f12d5142_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_stakeholders_project_id_f12d5142" ON "futures_stakeholders" ("project_id"); ALTER TABLE "futures_scenario_drivers" ADD CONSTRAINT "futures_scenario_dri_driver_id_2afb1fbb_fk_futures_d" FOREIGN KEY ("driver_id") REFERENCES "futures_drivers" ("driver_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_scenario_drivers" ADD CONSTRAINT "futures_scenario_dri_project_id_ab228456_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_scenario_drivers" ADD CONSTRAINT "futures_scenario_dri_scenario_id_bd3e3e72_fk_futures_s" FOREIGN KEY ("scenario_id") REFERENCES "futures_scenarios" ("scenario_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_scenario_drivers_driver_id_2afb1fbb" ON "futures_scenario_drivers" ("driver_id"); CREATE INDEX "futures_scenario_drivers_project_id_ab228456" ON "futures_scenario_drivers" ("project_id"); CREATE INDEX "futures_scenario_drivers_scenario_id_bd3e3e72" ON "futures_scenario_drivers" ("scenario_id"); ALTER TABLE "futures_driver_signals" ADD CONSTRAINT "futures_driver_signa_driver_id_32a4d5f8_fk_futures_d" FOREIGN KEY ("driver_id") REFERENCES "futures_drivers" ("driver_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_driver_signals" ADD CONSTRAINT "futures_driver_signa_project_id_9865e82b_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_driver_signals" ADD CONSTRAINT "futures_driver_signa_signal_id_8eae928b_fk_futures_s" FOREIGN KEY ("signal_id") REFERENCES "futures_signals" ("signal_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_driver_signals_driver_id_32a4d5f8" ON "futures_driver_signals" ("driver_id"); CREATE INDEX "futures_driver_signals_project_id_9865e82b" ON "futures_driver_signals" ("project_id"); CREATE INDEX "futures_driver_signals_signal_id_8eae928b" ON "futures_driver_signals" ("signal_id"); -- futures 0003_alter_futuresdomaincategories_category_name_and_more -- -- Alter field category_name on futuresdomaincategories -- ALTER TABLE "futures_domain_categories" ALTER COLUMN "category_name" TYPE varchar(255); -- -- Alter field category_path on futuresdomaincategories -- ALTER TABLE "futures_domain_categories" ALTER COLUMN "category_path" TYPE varchar(512); -- futures 0004_remove_futuressignals_project_and_more -- -- Add field url_normalized to futuressignals -- ALTER TABLE "futures_signals" ADD COLUMN "url_normalized" varchar(1000) DEFAULT '' NOT NULL; ALTER TABLE "futures_signals" ALTER COLUMN "url_normalized" DROP DEFAULT; -- -- Raw Python operation -- -- THIS OPERATION CANNOT BE WRITTEN AS SQL CREATE INDEX "futures_signals_url_normalized_46906516" ON "futures_signals" ("url_normalized"); CREATE INDEX "futures_signals_url_normalized_46906516_like" ON "futures_signals" ("url_normalized" varchar_pattern_ops); -- futures 0005_remove_futuresscenarios_scenario_title_and_more -- -- Add field scenario_sections to futuresscenarios -- ALTER TABLE "futures_scenarios" ADD COLUMN "scenario_sections" jsonb DEFAULT '{}'::jsonb NOT NULL; ALTER TABLE "futures_scenarios" ALTER COLUMN "scenario_sections" DROP DEFAULT; -- futures 0006_futuresdrivers_created_on_and_more -- -- Add field created_on to futuresdrivers -- ALTER TABLE "futures_drivers" ADD COLUMN "created_on" timestamp with time zone DEFAULT '2026-04-10 01:38:27.028122+00:00'::timestamptz NOT NULL; ALTER TABLE "futures_drivers" ALTER COLUMN "created_on" DROP DEFAULT; -- -- Add field created_on to futuresscenariodrivers -- ALTER TABLE "futures_scenario_drivers" ADD COLUMN "created_on" timestamp with time zone DEFAULT '2026-04-10 01:38:27.088227+00:00'::timestamptz NOT NULL; ALTER TABLE "futures_scenario_drivers" ALTER COLUMN "created_on" DROP DEFAULT; -- -- Add field created_on to futuresscenarios -- ALTER TABLE "futures_scenarios" ADD COLUMN "created_on" timestamp with time zone DEFAULT '2026-04-10 01:38:27.099577+00:00'::timestamptz NOT NULL; ALTER TABLE "futures_scenarios" ALTER COLUMN "created_on" DROP DEFAULT; -- futures 0009_vision -- -- Create model Vision -- CREATE TABLE "futures_vision" ("id" uuid NOT NULL PRIMARY KEY, "statement" text NOT NULL, "prompts" jsonb NOT NULL, "status" varchar(10) NOT NULL, "updated_at" timestamp with time zone NOT NULL, "created_at" timestamp with time zone NOT NULL, "project_id" uuid NOT NULL UNIQUE, CONSTRAINT "unique_project_vision" UNIQUE ("project_id")); ALTER TABLE "futures_vision" ADD CONSTRAINT "futures_vision_project_id_838d3926_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; -- futures 0011_newsitem_embedding_and_artifacts -- -- Create model FuturesArtifactSet -- CREATE TABLE "futures_artifact_sets" ("artifact_set_id" uuid NOT NULL PRIMARY KEY, "artifact_set_status" varchar(50) NOT NULL, "created_on" timestamp with time zone NOT NULL, "project_id" uuid NOT NULL, "scenario_set_id" uuid NOT NULL); -- -- Create model FuturesArtifacts -- CREATE TABLE "futures_artifacts" ("artifact_id" uuid NOT NULL PRIMARY KEY, "title" varchar(255) NULL, "artifact_type" varchar(255) NULL, "who_uses_it" varchar(255) NULL, "significance" varchar(1024) NULL, "relationship_to_scenario" varchar(1024) NULL, "image" varchar(100) NULL, "created_on" timestamp with time zone NOT NULL, "last_modified" timestamp with time zone NOT NULL, "scenario_id" uuid NOT NULL, "project_id" uuid NOT NULL, "artifact_set_id" uuid NOT NULL); ALTER TABLE "futures_artifact_sets" ADD CONSTRAINT "futures_artifact_set_project_id_6bc5f1f7_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_artifact_sets" ADD CONSTRAINT "futures_artifact_set_scenario_set_id_f6c88a49_fk_futures_s" FOREIGN KEY ("scenario_set_id") REFERENCES "futures_scenario_sets" ("scenario_set_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_artifact_sets_project_id_6bc5f1f7" ON "futures_artifact_sets" ("project_id"); CREATE INDEX "futures_artifact_sets_scenario_set_id_f6c88a49" ON "futures_artifact_sets" ("scenario_set_id"); ALTER TABLE "futures_artifacts" ADD CONSTRAINT "futures_artifacts_scenario_id_f1f0a191_fk_futures_s" FOREIGN KEY ("scenario_id") REFERENCES "futures_scenarios" ("scenario_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_artifacts" ADD CONSTRAINT "futures_artifacts_project_id_2ce3593a_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_artifacts" ADD CONSTRAINT "futures_artifacts_artifact_set_id_1a31d0d4_fk_futures_a" FOREIGN KEY ("artifact_set_id") REFERENCES "futures_artifact_sets" ("artifact_set_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_artifacts_scenario_id_f1f0a191" ON "futures_artifacts" ("scenario_id"); CREATE INDEX "futures_artifacts_project_id_2ce3593a" ON "futures_artifacts" ("project_id"); CREATE INDEX "futures_artifacts_artifact_set_id_1a31d0d4" ON "futures_artifacts" ("artifact_set_id"); -- futures 0012_signal_embedding -- -- Add field embedding to futuressignals -- ALTER TABLE "futures_signals" ADD COLUMN "embedding" vector(1536) NULL; -- -- Raw SQL operation -- CREATE INDEX IF NOT EXISTS futures_signals_embedding_idx ON futures_signals USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 64); -- futures 0013_futuressignals_source_type -- -- Add field source_type to futuressignals -- ALTER TABLE "futures_signals" ADD COLUMN "source_type" varchar(10) NULL; CREATE INDEX "futures_signals_source_type_8e55f46d" ON "futures_signals" ("source_type"); CREATE INDEX "futures_signals_source_type_8e55f46d_like" ON "futures_signals" ("source_type" varchar_pattern_ops); -- futures 0015_steeptrend_steeptrendevidence_trendrecommendation -- -- Create model SteepTrend -- CREATE TABLE "futures_steep_trend" ("trend_id" uuid NOT NULL PRIMARY KEY, "steep" varchar(50) NOT NULL, "topic" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "summary" text NOT NULL, "detail" text NOT NULL, "source_label" varchar(255) NOT NULL, "source_url" varchar(512) NOT NULL, "status" varchar(10) NOT NULL, "last_synthesized_at" timestamp with time zone NULL, "embedding" vector(1536) NULL, "created_on" timestamp with time zone NOT NULL, "updated_on" timestamp with time zone NOT NULL); -- -- Create model SteepTrendEvidence -- CREATE TABLE "futures_steep_trend_evidence" ("evidence_id" uuid NOT NULL PRIMARY KEY, "source_label" varchar(255) NOT NULL, "source_url" varchar(512) NOT NULL, "is_contrary" boolean NOT NULL, "relevance_note" text NOT NULL, "added_at" timestamp with time zone NOT NULL, "expires_at" timestamp with time zone NOT NULL, "news_item_id" uuid NULL, "signal_id" uuid NULL, "trend_id" uuid NOT NULL); -- -- Create model TrendRecommendation -- CREATE TABLE "futures_trend_recommendation" ("rec_id" uuid NOT NULL PRIMARY KEY, "kind" varchar(25) NOT NULL, "status" varchar(10) NOT NULL, "justification" text NOT NULL, "proposed_data" jsonb NOT NULL, "created_at" timestamp with time zone NOT NULL, "reviewed_at" timestamp with time zone NULL, "reviewer_note" varchar(500) NOT NULL, "reviewed_by_id" integer NULL, "target_trend_id" uuid NULL, "task_id" uuid NOT NULL); CREATE INDEX "futures_steep_trend_status_51635ea4" ON "futures_steep_trend" ("status"); CREATE INDEX "futures_steep_trend_status_51635ea4_like" ON "futures_steep_trend" ("status" varchar_pattern_ops); ALTER TABLE "futures_steep_trend_evidence" ADD CONSTRAINT "futures_steep_trend__news_item_id_804fd8ee_fk_futures_n" FOREIGN KEY ("news_item_id") REFERENCES "futures_newsitem" ("item_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_steep_trend_evidence" ADD CONSTRAINT "futures_steep_trend__signal_id_95cf1683_fk_futures_s" FOREIGN KEY ("signal_id") REFERENCES "futures_signals" ("signal_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_steep_trend_evidence" ADD CONSTRAINT "futures_steep_trend__trend_id_08ab305a_fk_futures_s" FOREIGN KEY ("trend_id") REFERENCES "futures_steep_trend" ("trend_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_steep_trend_evidence_news_item_id_804fd8ee" ON "futures_steep_trend_evidence" ("news_item_id"); CREATE INDEX "futures_steep_trend_evidence_signal_id_95cf1683" ON "futures_steep_trend_evidence" ("signal_id"); CREATE INDEX "futures_steep_trend_evidence_trend_id_08ab305a" ON "futures_steep_trend_evidence" ("trend_id"); ALTER TABLE "futures_trend_recommendation" ADD CONSTRAINT "futures_trend_recomm_reviewed_by_id_cab5e4db_fk_users_use" FOREIGN KEY ("reviewed_by_id") REFERENCES "users_user" ("id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_trend_recommendation" ADD CONSTRAINT "futures_trend_recomm_target_trend_id_cb3927f0_fk_futures_s" FOREIGN KEY ("target_trend_id") REFERENCES "futures_steep_trend" ("trend_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_trend_recommendation" ADD CONSTRAINT "futures_trend_recomm_task_id_1d7fe11d_fk_futures_a" FOREIGN KEY ("task_id") REFERENCES "futures_apptask" ("id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_trend_recommendation_kind_2cc0c175" ON "futures_trend_recommendation" ("kind"); CREATE INDEX "futures_trend_recommendation_kind_2cc0c175_like" ON "futures_trend_recommendation" ("kind" varchar_pattern_ops); CREATE INDEX "futures_trend_recommendation_status_687c07e8" ON "futures_trend_recommendation" ("status"); CREATE INDEX "futures_trend_recommendation_status_687c07e8_like" ON "futures_trend_recommendation" ("status" varchar_pattern_ops); CREATE INDEX "futures_trend_recommendation_reviewed_by_id_cab5e4db" ON "futures_trend_recommendation" ("reviewed_by_id"); CREATE INDEX "futures_trend_recommendation_target_trend_id_cb3927f0" ON "futures_trend_recommendation" ("target_trend_id"); CREATE INDEX "futures_trend_recommendation_task_id_1d7fe11d" ON "futures_trend_recommendation" ("task_id"); -- futures 0016_trends_config -- -- Create model TrendsConfig -- CREATE TABLE "futures_trends_config" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "access_level" varchar(10) NOT NULL); -- futures 0017_trends_config_discovery_cursor -- -- Add field discovery_processed_through to trendsconfig -- ALTER TABLE "futures_trends_config" ADD COLUMN "discovery_processed_through" timestamp with time zone NULL; -- futures 0019_futuresdrivertrends -- -- Create model FuturesDriverTrends -- CREATE TABLE "futures_driver_trends" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "short_description" varchar(1024) NOT NULL, "created_on" timestamp with time zone NOT NULL, "driver_id" uuid NOT NULL, "project_id" uuid NOT NULL, "trend_id" uuid NULL); ALTER TABLE "futures_driver_trends" ADD CONSTRAINT "futures_driver_trends_driver_id_trend_id_92338edb_uniq" UNIQUE ("driver_id", "trend_id"); ALTER TABLE "futures_driver_trends" ADD CONSTRAINT "futures_driver_trend_driver_id_18e71506_fk_futures_d" FOREIGN KEY ("driver_id") REFERENCES "futures_drivers" ("driver_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_driver_trends" ADD CONSTRAINT "futures_driver_trend_project_id_bb035e08_fk_futures_p" FOREIGN KEY ("project_id") REFERENCES "futures_projects" ("project_id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "futures_driver_trends" ADD CONSTRAINT "futures_driver_trend_trend_id_f0e39d9e_fk_futures_s" FOREIGN KEY ("trend_id") REFERENCES "futures_steep_trend" ("trend_id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_driver_trends_driver_id_18e71506" ON "futures_driver_trends" ("driver_id"); CREATE INDEX "futures_driver_trends_project_id_bb035e08" ON "futures_driver_trends" ("project_id"); CREATE INDEX "futures_driver_trends_trend_id_f0e39d9e" ON "futures_driver_trends" ("trend_id"); -- futures 0021_digestuploadchunk_delete_digestupload -- -- Create model DigestUploadChunk -- CREATE TABLE "futures_digestuploadchunk" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "chunk_index" integer NOT NULL, "data" bytea NOT NULL, "task_id" uuid NOT NULL); ALTER TABLE "futures_digestuploadchunk" ADD CONSTRAINT "futures_digestupload_task_id_801680dd_fk_futures_a" FOREIGN KEY ("task_id") REFERENCES "futures_apptask" ("id") DEFERRABLE INITIALLY DEFERRED; CREATE INDEX "futures_digestuploadchunk_task_id_801680dd" ON "futures_digestuploadchunk" ("task_id"); -- futures 0022_trendsconfig_signals_curated_through_date -- -- Add field signals_curated_through_date to trendsconfig -- ALTER TABLE "futures_trends_config" ADD COLUMN "signals_curated_through_date" date NULL;