PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE IF NOT EXISTS "action_text_rich_texts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "body" text, "record_type" varchar NOT NULL, "record_id" bigint NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); CREATE TABLE IF NOT EXISTS "active_storage_blobs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "filename" varchar NOT NULL, "content_type" varchar, "metadata" text, "service_name" varchar NOT NULL, "byte_size" bigint NOT NULL, "checksum" varchar, "created_at" datetime(6) NOT NULL); CREATE TABLE IF NOT EXISTS "ages" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "category" varchar, "description" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); INSERT INTO ages VALUES(1,'J','< 17','2024-12-16 21:13:56.839092','2024-12-16 21:13:56.839092'); INSERT INTO ages VALUES(2,'A','18-35','2024-12-16 21:13:56.843790','2024-12-16 21:13:56.843790'); INSERT INTO ages VALUES(3,'A1','36-45','2024-12-16 21:13:56.846989','2024-12-16 21:13:56.846989'); INSERT INTO ages VALUES(4,'B','46-54','2024-12-16 21:13:56.858101','2024-12-16 21:13:56.858101'); INSERT INTO ages VALUES(5,'B1','55-65','2024-12-16 21:13:56.861658','2024-12-16 21:13:56.861658'); INSERT INTO ages VALUES(6,'C','66-75','2024-12-16 21:13:56.864049','2024-12-16 21:13:56.864049'); INSERT INTO ages VALUES(7,'C1','76-85','2024-12-16 21:13:56.867425','2024-12-16 21:13:56.867425'); INSERT INTO ages VALUES(8,'D','86+','2024-12-16 21:13:56.869407','2024-12-16 21:13:56.869407'); CREATE TABLE IF NOT EXISTS "billables" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "name" varchar, "price" decimal(7,2), "order" integer, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "couples" boolean DEFAULT 0); CREATE TABLE IF NOT EXISTS "categories" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "order" integer, "day" varchar, "time" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "ballrooms" integer, "max_heat_size" integer, "heats" integer, "routines" boolean, "duration" integer, "cost_override" decimal(7,2), "pro" boolean DEFAULT 0, "locked" boolean, "studio_cost_override" decimal(7,2)); CREATE TABLE IF NOT EXISTS "levels" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); INSERT INTO levels VALUES(1,'Newcomer','2024-12-16 21:13:56.885541','2024-12-16 21:13:56.885541'); INSERT INTO levels VALUES(2,'Assoc. Bronze','2024-12-16 21:13:56.892380','2024-12-16 21:13:56.892380'); INSERT INTO levels VALUES(3,'Full Bronze','2024-12-16 21:13:56.895448','2024-12-16 21:13:56.895448'); INSERT INTO levels VALUES(4,'Assoc. Silver','2024-12-16 21:13:56.897860','2024-12-16 21:13:56.897860'); INSERT INTO levels VALUES(5,'Full Silver','2024-12-16 21:13:56.899950','2024-12-16 21:13:56.899950'); INSERT INTO levels VALUES(6,'Assoc. Gold','2024-12-16 21:13:56.910636','2024-12-16 21:13:56.910636'); INSERT INTO levels VALUES(7,'Full Gold','2024-12-16 21:13:56.917234','2024-12-16 21:13:56.917234'); CREATE TABLE IF NOT EXISTS "users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "userid" varchar, "password" varchar, "email" varchar, "name1" varchar, "name2" varchar, "token" varchar, "link" varchar, "sites" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); CREATE TABLE IF NOT EXISTS "active_storage_attachments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "record_type" varchar NOT NULL, "record_id" bigint NOT NULL, "blob_id" bigint NOT NULL, "created_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_c3b3935057" FOREIGN KEY ("blob_id") REFERENCES "active_storage_blobs" ("id") ); CREATE TABLE IF NOT EXISTS "active_storage_variant_records" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "blob_id" bigint NOT NULL, "variation_digest" varchar NOT NULL, CONSTRAINT "fk_rails_993965df05" FOREIGN KEY ("blob_id") REFERENCES "active_storage_blobs" ("id") ); CREATE TABLE IF NOT EXISTS "age_costs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "age_id" integer NOT NULL, "heat_cost" decimal(7,2) DEFAULT NULL, "solo_cost" decimal(7,2) DEFAULT NULL, "multi_cost" decimal(7,2) DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_adbcea596f" FOREIGN KEY ("age_id") REFERENCES "ages" ("id") ); CREATE TABLE IF NOT EXISTS "cat_extensions" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "category_id" integer NOT NULL, "start_heat" integer DEFAULT NULL, "part" integer DEFAULT NULL, "order" integer DEFAULT NULL, "day" varchar DEFAULT NULL, "time" varchar DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "duration" integer DEFAULT NULL, CONSTRAINT "fk_rails_fda0eb00b0" FOREIGN KEY ("category_id") REFERENCES "categories" ("id") ); CREATE TABLE IF NOT EXISTS "dances" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "open_category_id" integer DEFAULT NULL, "closed_category_id" integer DEFAULT NULL, "order" integer DEFAULT NULL, "solo_category_id" integer DEFAULT NULL, "multi_category_id" integer DEFAULT NULL, "heat_length" integer DEFAULT NULL, "row" integer DEFAULT NULL, "col" integer DEFAULT NULL, "cost_override" decimal(7,2) DEFAULT NULL, "pro_open_category_id" integer DEFAULT NULL, "pro_closed_category_id" integer DEFAULT NULL, "pro_solo_category_id" integer DEFAULT NULL, "pro_multi_category_id" integer DEFAULT NULL, "semi_finals" boolean DEFAULT 0, "limit" integer DEFAULT NULL, CONSTRAINT "fk_rails_efaaf34809" FOREIGN KEY ("pro_solo_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_a72388b9e3" FOREIGN KEY ("pro_multi_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_644cc2a7ac" FOREIGN KEY ("open_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_554eda2935" FOREIGN KEY ("closed_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_c8a6cf7eac" FOREIGN KEY ("multi_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_0d39d088ac" FOREIGN KEY ("pro_closed_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_60c33dc1c5" FOREIGN KEY ("pro_open_category_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_e0d2797603" FOREIGN KEY ("solo_category_id") REFERENCES "categories" ("id") ); INSERT INTO dances VALUES(1,'Waltz','2024-12-16 21:13:56.981009','2024-12-16 21:13:56.981009',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(2,'Fox Trot','2024-12-16 21:13:56.991382','2024-12-16 21:13:56.991382',NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(3,'Tango','2024-12-16 21:13:56.999887','2024-12-16 21:13:56.999887',NULL,NULL,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(4,'V. Waltz','2024-12-16 21:13:57.006404','2024-12-16 21:13:57.006404',NULL,NULL,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(5,'Quickstep','2024-12-16 21:13:57.012214','2024-12-16 21:13:57.012214',NULL,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(6,'Peabody','2024-12-16 21:13:57.017567','2024-12-16 21:13:57.017567',NULL,NULL,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(7,'Arg. Tango','2024-12-16 21:13:57.024144','2024-12-16 21:13:57.024144',NULL,NULL,7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(8,'Salsa','2024-12-16 21:13:57.030369','2024-12-16 21:13:57.030369',NULL,NULL,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(9,'Rumba','2024-12-16 21:13:57.035832','2024-12-16 21:13:57.035832',NULL,NULL,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(10,'Cha Cha','2024-12-16 21:13:57.061282','2024-12-16 21:13:57.061282',NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(11,'Merengue','2024-12-16 21:13:57.070222','2024-12-16 21:13:57.070222',NULL,NULL,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(12,'Samba','2024-12-16 21:13:57.082275','2024-12-16 21:13:57.082275',NULL,NULL,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(13,'Bolero','2024-12-16 21:13:57.097289','2024-12-16 21:13:57.097289',NULL,NULL,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(14,'Paso Doble','2024-12-16 21:13:57.104694','2024-12-16 21:13:57.104694',NULL,NULL,14,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(15,'Mambo','2024-12-16 21:13:57.111856','2024-12-16 21:13:57.111856',NULL,NULL,15,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(16,'WCS','2024-12-16 21:13:57.116061','2024-12-16 21:13:57.116061',NULL,NULL,16,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(17,'Bachata','2024-12-16 21:13:57.119409','2024-12-16 21:13:57.119409',NULL,NULL,17,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(18,'ECS','2024-12-16 21:13:57.121926','2024-12-16 21:13:57.121926',NULL,NULL,18,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(19,'Hustle','2024-12-16 21:13:57.124865','2024-12-16 21:13:57.124865',NULL,NULL,19,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(20,'CW Swing','2024-12-16 21:13:57.127659','2024-12-16 21:13:57.127659',NULL,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(21,'Lindy Hop','2024-12-16 21:13:57.130388','2024-12-16 21:13:57.130388',NULL,NULL,21,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(22,'CW Waltz','2024-12-16 21:13:57.132730','2024-12-16 21:13:57.132730',NULL,NULL,22,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(23,'CW Cha Cha','2024-12-16 21:13:57.135094','2024-12-16 21:13:57.135094',NULL,NULL,23,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(24,'NC2','2024-12-16 21:13:57.137468','2024-12-16 21:13:57.137468',NULL,NULL,24,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(25,'CW Two Step','2024-12-16 21:13:57.141355','2024-12-16 21:13:57.141355',NULL,NULL,25,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(26,'CW Three Step','2024-12-16 21:13:57.144911','2024-12-16 21:13:57.144911',NULL,NULL,26,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(27,'CW Shuffle','2024-12-16 21:13:57.147907','2024-12-16 21:13:57.147907',NULL,NULL,27,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(28,'Swing','2024-12-16 21:13:57.150177','2024-12-16 21:13:57.150177',NULL,NULL,28,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(29,'4 Count','2024-12-16 21:13:57.155106','2024-12-16 21:13:57.155106',NULL,NULL,29,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); INSERT INTO dances VALUES(30,'Polka','2024-12-16 21:13:57.163330','2024-12-16 21:13:57.163330',NULL,NULL,30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL); CREATE TABLE IF NOT EXISTS "entries" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "age_id" integer NOT NULL, "level_id" integer NOT NULL, "lead_id" integer NOT NULL, "follow_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "instructor_id" integer DEFAULT NULL, CONSTRAINT "fk_rails_41604fefcd" FOREIGN KEY ("instructor_id") REFERENCES "people" ("id") , CONSTRAINT "fk_rails_0e8c121ba1" FOREIGN KEY ("level_id") REFERENCES "levels" ("id") , CONSTRAINT "fk_rails_1473a8d842" FOREIGN KEY ("age_id") REFERENCES "ages" ("id") , CONSTRAINT "fk_rails_48a5b954b2" FOREIGN KEY ("follow_id") REFERENCES "people" ("id") , CONSTRAINT "fk_rails_b40855fc29" FOREIGN KEY ("lead_id") REFERENCES "people" ("id") ); CREATE TABLE IF NOT EXISTS "events" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar DEFAULT NULL, "location" varchar DEFAULT NULL, "date" varchar DEFAULT NULL, "heat_range_cat" integer DEFAULT NULL, "heat_range_level" integer DEFAULT NULL, "heat_range_age" integer DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "intermix" boolean DEFAULT 1, "current_heat" integer DEFAULT NULL, "ballrooms" integer DEFAULT 1, "heat_length" integer DEFAULT NULL, "heat_cost" decimal(7,2) DEFAULT NULL, "solo_cost" decimal(7,2) DEFAULT NULL, "multi_cost" decimal(7,2) DEFAULT NULL, "email" varchar DEFAULT NULL, "max_heat_size" integer DEFAULT NULL, "package_required" boolean DEFAULT 1, "backnums" boolean DEFAULT 1, "track_ages" boolean DEFAULT 1, "column_order" integer DEFAULT 1, "open_scoring" varchar DEFAULT '1', "solo_length" integer DEFAULT NULL, "theme" varchar DEFAULT NULL, "locked" boolean DEFAULT 0, "student_package_description" varchar DEFAULT NULL, "payment_due" varchar DEFAULT NULL, "multi_scoring" varchar DEFAULT '1', "judge_comments" boolean DEFAULT 0, "agenda_based_entries" boolean DEFAULT 0, "pro_heats" boolean DEFAULT 0, "assign_judges" integer DEFAULT 0, "font_size" varchar DEFAULT '100%', "include_times" boolean DEFAULT 1, "include_open" boolean DEFAULT 1, "include_closed" boolean DEFAULT 1, "solo_level_id" integer DEFAULT NULL, "print_studio_heats" boolean DEFAULT 0, "font_family" varchar DEFAULT 'Helvetica, Arial', "independent_instructors" boolean DEFAULT 0, "closed_scoring" varchar DEFAULT 'G', "heat_order" varchar DEFAULT 'L', "dance_limit" integer DEFAULT NULL, "counter_color" varchar DEFAULT '#FFFFFF', "pro_heat_cost" decimal(7,2) DEFAULT NULL, "pro_solo_cost" decimal(7,2) DEFAULT NULL, "pro_multi_cost" decimal(7,2) DEFAULT NULL, CONSTRAINT "fk_rails_353c42da39" FOREIGN KEY ("solo_level_id") REFERENCES "levels" ("id") ); INSERT INTO events VALUES(1,'Showcase','TBD',NULL,0,3,7,'2024-12-16 21:13:56.735723','2024-12-16 21:13:56.735723',1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,1,1,1,1,'1',NULL,NULL,0,NULL,NULL,'1',0,0,0,0,'100%',1,1,1,NULL,0,'Helvetica, Arial',0,'G','L',NULL,'#FFFFFF',NULL,NULL,NULL); CREATE TABLE IF NOT EXISTS "formations" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "person_id" integer NOT NULL, "solo_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "on_floor" boolean DEFAULT 1, CONSTRAINT "fk_rails_f20cf47ef6" FOREIGN KEY ("person_id") REFERENCES "people" ("id") , CONSTRAINT "fk_rails_e788fbf735" FOREIGN KEY ("solo_id") REFERENCES "solos" ("id") ); CREATE TABLE IF NOT EXISTS "heats" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "number" float DEFAULT NULL, "category" varchar DEFAULT NULL, "dance_id" integer NOT NULL, "entry_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "ballroom" varchar DEFAULT NULL, "prev_number" float DEFAULT NULL, CONSTRAINT "fk_rails_1032ada29d" FOREIGN KEY ("dance_id") REFERENCES "dances" ("id") , CONSTRAINT "fk_rails_297e667660" FOREIGN KEY ("entry_id") REFERENCES "entries" ("id") ); CREATE TABLE IF NOT EXISTS "judges" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "person_id" integer NOT NULL, "sort" varchar DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "show_assignments" varchar DEFAULT 'first' NOT NULL, "present" boolean DEFAULT 1 NOT NULL, "ballroom" varchar DEFAULT 'Both' NOT NULL, "review_solos" varchar DEFAULT 'All', CONSTRAINT "fk_rails_226026eca9" FOREIGN KEY ("person_id") REFERENCES "people" ("id") ); CREATE TABLE IF NOT EXISTS "locations" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar DEFAULT NULL, "name" varchar DEFAULT NULL, "logo" varchar DEFAULT NULL, "latitude" float DEFAULT NULL, "longitude" float DEFAULT NULL, "user_id" integer DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "region" varchar DEFAULT NULL, "sisters" varchar DEFAULT NULL, "trust_level" integer DEFAULT 0, CONSTRAINT "fk_rails_5e107925c6" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ); CREATE TABLE IF NOT EXISTS "multis" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "dance_id" integer NOT NULL, "slot" integer DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_5f0ab7bd74" FOREIGN KEY ("dance_id") REFERENCES "dances" ("id") , CONSTRAINT "fk_rails_2ef82a9a07" FOREIGN KEY ("parent_id") REFERENCES "dances" ("id") ); CREATE TABLE IF NOT EXISTS "package_includes" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "package_id" integer NOT NULL, "option_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_4b0115715f" FOREIGN KEY ("option_id") REFERENCES "billables" ("id") , CONSTRAINT "fk_rails_bf7e60660c" FOREIGN KEY ("package_id") REFERENCES "billables" ("id") ); CREATE TABLE IF NOT EXISTS "people" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar DEFAULT NULL, "studio_id" integer DEFAULT NULL, "type" varchar DEFAULT NULL, "back" integer DEFAULT NULL, "level_id" integer DEFAULT NULL, "age_id" integer DEFAULT NULL, "role" varchar DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "exclude_id" integer DEFAULT NULL, "package_id" integer DEFAULT NULL, "independent" boolean DEFAULT 0, "invoice_to_id" integer DEFAULT NULL, CONSTRAINT "fk_rails_3465b321b7" FOREIGN KEY ("invoice_to_id") REFERENCES "people" ("id") , CONSTRAINT "fk_rails_8e98466fd8" FOREIGN KEY ("level_id") REFERENCES "levels" ("id") , CONSTRAINT "fk_rails_b309eae9fc" FOREIGN KEY ("age_id") REFERENCES "ages" ("id") , CONSTRAINT "fk_rails_0c600b2fd9" FOREIGN KEY ("package_id") REFERENCES "billables" ("id") , CONSTRAINT "fk_rails_6039193ecf" FOREIGN KEY ("exclude_id") REFERENCES "people" ("id") , CONSTRAINT "fk_rails_2e4d98b701" FOREIGN KEY ("studio_id") REFERENCES "studios" ("id") ); CREATE TABLE IF NOT EXISTS "person_options" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "person_id" integer NOT NULL, "option_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_885b701507" FOREIGN KEY ("option_id") REFERENCES "billables" ("id") , CONSTRAINT "fk_rails_5b7e3c91fa" FOREIGN KEY ("person_id") REFERENCES "people" ("id") ); CREATE TABLE IF NOT EXISTS "scores" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "judge_id" integer NOT NULL, "heat_id" integer NOT NULL, "value" varchar DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "slot" integer DEFAULT NULL, "comments" varchar DEFAULT NULL, "good" varchar DEFAULT NULL, "bad" varchar DEFAULT NULL, CONSTRAINT "fk_rails_daa05f37c9" FOREIGN KEY ("heat_id") REFERENCES "heats" ("id") , CONSTRAINT "fk_rails_017a0f7b77" FOREIGN KEY ("judge_id") REFERENCES "people" ("id") ); CREATE TABLE IF NOT EXISTS "showcases" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "year" integer DEFAULT NULL, "key" varchar DEFAULT NULL, "name" varchar DEFAULT NULL, "location_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "order" integer DEFAULT NULL, CONSTRAINT "fk_rails_db0b14f076" FOREIGN KEY ("location_id") REFERENCES "locations" ("id") ); CREATE TABLE IF NOT EXISTS "solos" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "heat_id" integer NOT NULL, "combo_dance_id" integer DEFAULT NULL, "order" integer DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "song" varchar DEFAULT NULL, "artist" varchar DEFAULT NULL, "category_override_id" integer DEFAULT NULL, CONSTRAINT "fk_rails_252e198306" FOREIGN KEY ("combo_dance_id") REFERENCES "dances" ("id") , CONSTRAINT "fk_rails_c780c08f0b" FOREIGN KEY ("category_override_id") REFERENCES "categories" ("id") , CONSTRAINT "fk_rails_30394335b1" FOREIGN KEY ("heat_id") REFERENCES "heats" ("id") ); CREATE TABLE IF NOT EXISTS "songs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "dance_id" integer NOT NULL, "order" integer DEFAULT NULL, "title" varchar DEFAULT NULL, "artist" varchar DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_778db28f5b" FOREIGN KEY ("dance_id") REFERENCES "dances" ("id") ); CREATE TABLE IF NOT EXISTS "studio_pairs" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "studio1_id" integer NOT NULL, "studio2_id" integer NOT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, CONSTRAINT "fk_rails_06efca38af" FOREIGN KEY ("studio1_id") REFERENCES "studios" ("id") , CONSTRAINT "fk_rails_e50bcb4389" FOREIGN KEY ("studio2_id") REFERENCES "studios" ("id") ); CREATE TABLE IF NOT EXISTS "studios" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar DEFAULT NULL, "tables" integer DEFAULT NULL, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "heat_cost" decimal(7,2) DEFAULT NULL, "solo_cost" decimal(7,2) DEFAULT NULL, "multi_cost" decimal(7,2) DEFAULT NULL, "email" varchar DEFAULT NULL, "default_student_package_id" integer DEFAULT NULL, "default_professional_package_id" integer DEFAULT NULL, "default_guest_package_id" integer DEFAULT NULL, "student_registration_cost" decimal(7,2) DEFAULT NULL, "student_heat_cost" decimal(7,2) DEFAULT NULL, "student_solo_cost" decimal(7,2) DEFAULT NULL, "student_multi_cost" decimal(7,2) DEFAULT NULL, "ballroom" varchar DEFAULT NULL, CONSTRAINT "fk_rails_225cf92a86" FOREIGN KEY ("default_professional_package_id") REFERENCES "billables" ("id") , CONSTRAINT "fk_rails_7b6d29b5e9" FOREIGN KEY ("default_guest_package_id") REFERENCES "billables" ("id") , CONSTRAINT "fk_rails_2dd7380d43" FOREIGN KEY ("default_student_package_id") REFERENCES "billables" ("id") ); INSERT INTO studios VALUES(0,'Event Staff',NULL,'2024-12-16 21:13:56.811087','2024-12-16 21:13:56.811087',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); CREATE TABLE IF NOT EXISTS "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY); INSERT INTO schema_migrations VALUES('20241010143111'); INSERT INTO schema_migrations VALUES('20241002125818'); INSERT INTO schema_migrations VALUES('20241001130746'); INSERT INTO schema_migrations VALUES('20240831131433'); INSERT INTO schema_migrations VALUES('20240822010045'); INSERT INTO schema_migrations VALUES('20240804224317'); INSERT INTO schema_migrations VALUES('20240708213142'); INSERT INTO schema_migrations VALUES('20240708205904'); INSERT INTO schema_migrations VALUES('20240529200032'); INSERT INTO schema_migrations VALUES('20240512170708'); INSERT INTO schema_migrations VALUES('20240425003705'); INSERT INTO schema_migrations VALUES('20240324222321'); INSERT INTO schema_migrations VALUES('20240310223701'); INSERT INTO schema_migrations VALUES('20240229134705'); INSERT INTO schema_migrations VALUES('20240226132621'); INSERT INTO schema_migrations VALUES('20240219210158'); INSERT INTO schema_migrations VALUES('20240129193921'); INSERT INTO schema_migrations VALUES('20240120160513'); INSERT INTO schema_migrations VALUES('20240116131352'); INSERT INTO schema_migrations VALUES('20240109224242'); INSERT INTO schema_migrations VALUES('20231227064854'); INSERT INTO schema_migrations VALUES('20231220195604'); INSERT INTO schema_migrations VALUES('20231207142159'); INSERT INTO schema_migrations VALUES('20231115014415'); INSERT INTO schema_migrations VALUES('20231028131227'); INSERT INTO schema_migrations VALUES('20231027142506'); INSERT INTO schema_migrations VALUES('20231027142420'); INSERT INTO schema_migrations VALUES('20231025173707'); INSERT INTO schema_migrations VALUES('20231010012726'); INSERT INTO schema_migrations VALUES('20231001165834'); INSERT INTO schema_migrations VALUES('20230930144237'); INSERT INTO schema_migrations VALUES('20230923182922'); INSERT INTO schema_migrations VALUES('20230909234512'); INSERT INTO schema_migrations VALUES('20230901183948'); INSERT INTO schema_migrations VALUES('20230603231658'); INSERT INTO schema_migrations VALUES('20230430173328'); INSERT INTO schema_migrations VALUES('20230323024334'); INSERT INTO schema_migrations VALUES('20230124233129'); INSERT INTO schema_migrations VALUES('20230119174433'); INSERT INTO schema_migrations VALUES('20230119173959'); INSERT INTO schema_migrations VALUES('20221015184926'); INSERT INTO schema_migrations VALUES('20220910184733'); INSERT INTO schema_migrations VALUES('20220902165123'); INSERT INTO schema_migrations VALUES('20220824111138'); INSERT INTO schema_migrations VALUES('20220818222750'); INSERT INTO schema_migrations VALUES('20220802135733'); INSERT INTO schema_migrations VALUES('20220727000152'); INSERT INTO schema_migrations VALUES('20220723202802'); INSERT INTO schema_migrations VALUES('20220714122632'); INSERT INTO schema_migrations VALUES('20220712234830'); INSERT INTO schema_migrations VALUES('20220629150139'); INSERT INTO schema_migrations VALUES('20220622141547'); INSERT INTO schema_migrations VALUES('20220622011356'); INSERT INTO schema_migrations VALUES('20220616181115'); INSERT INTO schema_migrations VALUES('20220613132933'); INSERT INTO schema_migrations VALUES('20220611163304'); INSERT INTO schema_migrations VALUES('20220610120655'); INSERT INTO schema_migrations VALUES('20220604141131'); INSERT INTO schema_migrations VALUES('20220527143539'); INSERT INTO schema_migrations VALUES('20220519134900'); INSERT INTO schema_migrations VALUES('20220517173618'); INSERT INTO schema_migrations VALUES('20220516162358'); INSERT INTO schema_migrations VALUES('20220510161408'); INSERT INTO schema_migrations VALUES('20220510132924'); INSERT INTO schema_migrations VALUES('20220510132923'); INSERT INTO schema_migrations VALUES('20220509185821'); INSERT INTO schema_migrations VALUES('20220507162016'); INSERT INTO schema_migrations VALUES('20220501163652'); INSERT INTO schema_migrations VALUES('20220501163609'); INSERT INTO schema_migrations VALUES('20220501162747'); INSERT INTO schema_migrations VALUES('20220427225436'); INSERT INTO schema_migrations VALUES('20220427002212'); INSERT INTO schema_migrations VALUES('20220425210448'); INSERT INTO schema_migrations VALUES('20220421144933'); INSERT INTO schema_migrations VALUES('20220421013549'); INSERT INTO schema_migrations VALUES('20220310220503'); INSERT INTO schema_migrations VALUES('20220301223832'); INSERT INTO schema_migrations VALUES('20220223032029'); INSERT INTO schema_migrations VALUES('20220218152002'); INSERT INTO schema_migrations VALUES('20220217003153'); INSERT INTO schema_migrations VALUES('20220214194448'); INSERT INTO schema_migrations VALUES('20220212171521'); INSERT INTO schema_migrations VALUES('20220212001802'); INSERT INTO schema_migrations VALUES('20220208221606'); INSERT INTO schema_migrations VALUES('20220206193854'); INSERT INTO schema_migrations VALUES('20220206193836'); INSERT INTO schema_migrations VALUES('20220206180026'); INSERT INTO schema_migrations VALUES('20220202153834'); INSERT INTO schema_migrations VALUES('20220124133957'); INSERT INTO schema_migrations VALUES('20220122173243'); INSERT INTO schema_migrations VALUES('20220122173242'); INSERT INTO schema_migrations VALUES('20220122173241'); INSERT INTO schema_migrations VALUES('20220122173240'); CREATE TABLE IF NOT EXISTS "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL); INSERT INTO ar_internal_metadata VALUES('environment','production','2024-12-16 21:13:56.574811','2024-12-16 21:13:56.574817'); INSERT INTO ar_internal_metadata VALUES('schema_sha1','22dd3e0e757d11118ed0c4d67563ffdf98791f49','2024-12-16 21:13:56.583021','2024-12-16 21:13:56.583024'); DELETE FROM sqlite_sequence; INSERT INTO sqlite_sequence VALUES('active_storage_attachments',0); INSERT INTO sqlite_sequence VALUES('active_storage_variant_records',0); INSERT INTO sqlite_sequence VALUES('age_costs',0); INSERT INTO sqlite_sequence VALUES('cat_extensions',0); INSERT INTO sqlite_sequence VALUES('dances',30); INSERT INTO sqlite_sequence VALUES('entries',0); INSERT INTO sqlite_sequence VALUES('events',1); INSERT INTO sqlite_sequence VALUES('formations',0); INSERT INTO sqlite_sequence VALUES('heats',0); INSERT INTO sqlite_sequence VALUES('judges',0); INSERT INTO sqlite_sequence VALUES('locations',0); INSERT INTO sqlite_sequence VALUES('multis',0); INSERT INTO sqlite_sequence VALUES('package_includes',0); INSERT INTO sqlite_sequence VALUES('people',0); INSERT INTO sqlite_sequence VALUES('person_options',0); INSERT INTO sqlite_sequence VALUES('scores',0); INSERT INTO sqlite_sequence VALUES('showcases',0); INSERT INTO sqlite_sequence VALUES('solos',0); INSERT INTO sqlite_sequence VALUES('songs',0); INSERT INTO sqlite_sequence VALUES('studio_pairs',0); INSERT INTO sqlite_sequence VALUES('studios',0); INSERT INTO sqlite_sequence VALUES('ages',8); INSERT INTO sqlite_sequence VALUES('levels',7); CREATE UNIQUE INDEX "index_action_text_rich_texts_uniqueness" ON "action_text_rich_texts" ("record_type", "record_id", "name"); CREATE UNIQUE INDEX "index_active_storage_blobs_on_key" ON "active_storage_blobs" ("key"); CREATE INDEX "index_active_storage_attachments_on_blob_id" ON "active_storage_attachments" ("blob_id"); CREATE UNIQUE INDEX "index_active_storage_attachments_uniqueness" ON "active_storage_attachments" ("record_type", "record_id", "name", "blob_id"); CREATE UNIQUE INDEX "index_active_storage_variant_records_uniqueness" ON "active_storage_variant_records" ("blob_id", "variation_digest"); CREATE INDEX "index_age_costs_on_age_id" ON "age_costs" ("age_id"); CREATE INDEX "index_cat_extensions_on_category_id" ON "cat_extensions" ("category_id"); CREATE INDEX "index_dances_on_closed_category_id" ON "dances" ("closed_category_id"); CREATE INDEX "index_dances_on_multi_category_id" ON "dances" ("multi_category_id"); CREATE INDEX "index_dances_on_open_category_id" ON "dances" ("open_category_id"); CREATE INDEX "index_dances_on_pro_closed_category_id" ON "dances" ("pro_closed_category_id"); CREATE INDEX "index_dances_on_pro_multi_category_id" ON "dances" ("pro_multi_category_id"); CREATE INDEX "index_dances_on_pro_open_category_id" ON "dances" ("pro_open_category_id"); CREATE INDEX "index_dances_on_pro_solo_category_id" ON "dances" ("pro_solo_category_id"); CREATE INDEX "index_dances_on_solo_category_id" ON "dances" ("solo_category_id"); CREATE INDEX "index_entries_on_age_id" ON "entries" ("age_id"); CREATE INDEX "index_entries_on_follow_id" ON "entries" ("follow_id"); CREATE INDEX "index_entries_on_instructor_id" ON "entries" ("instructor_id"); CREATE INDEX "index_entries_on_lead_id" ON "entries" ("lead_id"); CREATE INDEX "index_entries_on_level_id" ON "entries" ("level_id"); CREATE INDEX "index_events_on_solo_level_id" ON "events" ("solo_level_id"); CREATE INDEX "index_formations_on_person_id" ON "formations" ("person_id"); CREATE INDEX "index_formations_on_solo_id" ON "formations" ("solo_id"); CREATE INDEX "index_heats_on_dance_id" ON "heats" ("dance_id"); CREATE INDEX "index_heats_on_entry_id" ON "heats" ("entry_id"); CREATE INDEX "index_judges_on_person_id" ON "judges" ("person_id"); CREATE INDEX "index_locations_on_user_id" ON "locations" ("user_id"); CREATE INDEX "index_multis_on_dance_id" ON "multis" ("dance_id"); CREATE INDEX "index_multis_on_parent_id" ON "multis" ("parent_id"); CREATE INDEX "index_package_includes_on_option_id" ON "package_includes" ("option_id"); CREATE INDEX "index_package_includes_on_package_id" ON "package_includes" ("package_id"); CREATE INDEX "index_people_on_age_id" ON "people" ("age_id"); CREATE INDEX "index_people_on_exclude_id" ON "people" ("exclude_id"); CREATE INDEX "index_people_on_invoice_to_id" ON "people" ("invoice_to_id"); CREATE INDEX "index_people_on_level_id" ON "people" ("level_id"); CREATE INDEX "index_people_on_package_id" ON "people" ("package_id"); CREATE INDEX "index_people_on_studio_id" ON "people" ("studio_id"); CREATE INDEX "index_person_options_on_option_id" ON "person_options" ("option_id"); CREATE INDEX "index_person_options_on_person_id" ON "person_options" ("person_id"); CREATE INDEX "index_scores_on_heat_id" ON "scores" ("heat_id"); CREATE INDEX "index_scores_on_judge_id" ON "scores" ("judge_id"); CREATE INDEX "index_showcases_on_location_id" ON "showcases" ("location_id"); CREATE INDEX "index_solos_on_category_override_id" ON "solos" ("category_override_id"); CREATE INDEX "index_solos_on_combo_dance_id" ON "solos" ("combo_dance_id"); CREATE INDEX "index_solos_on_heat_id" ON "solos" ("heat_id"); CREATE INDEX "index_songs_on_dance_id" ON "songs" ("dance_id"); CREATE INDEX "index_studio_pairs_on_studio1_id" ON "studio_pairs" ("studio1_id"); CREATE INDEX "index_studio_pairs_on_studio2_id" ON "studio_pairs" ("studio2_id"); CREATE INDEX "index_studios_on_default_guest_package_id" ON "studios" ("default_guest_package_id"); CREATE INDEX "index_studios_on_default_professional_package_id" ON "studios" ("default_professional_package_id"); CREATE INDEX "index_studios_on_default_student_package_id" ON "studios" ("default_student_package_id"); COMMIT;