From d733ee7668a623cb08643ebf4098bffbb725a10c Mon Sep 17 00:00:00 2001 From: Marco de Jongh <1107647+marcodejongh@users.noreply.github.com> Date: Tue, 7 Jan 2025 22:46:11 +1100 Subject: [PATCH] Add seperate table for the hold mapping We'll use this table to implement hold search as this will be more powerful AND more performant than using a string lookup on the frame frames string --- .../[set_ids]/[angle]/[climb_uuid]/route.ts | 3 +- app/components/board-renderer/util.ts | 48 +- app/lib/data-sync/aurora/shared-sync.ts | 25 +- app/lib/db/queries/search-climbs.ts | 5 +- app/lib/db/queries/util/table-select.ts | 5 + app/lib/db/schema.ts | 54 + drizzle/0011_add_holds_map_table.sql | 112 + drizzle/meta/0011_snapshot.json | 4222 +++++++++++++++++ drizzle/meta/_journal.json | 7 + 9 files changed, 4458 insertions(+), 23 deletions(-) create mode 100644 drizzle/0011_add_holds_map_table.sql create mode 100644 drizzle/meta/0011_snapshot.json diff --git a/app/api/v1/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/[climb_uuid]/route.ts b/app/api/v1/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/[climb_uuid]/route.ts index ee02173..f083227 100644 --- a/app/api/v1/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/[climb_uuid]/route.ts +++ b/app/api/v1/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/[climb_uuid]/route.ts @@ -13,7 +13,8 @@ export async function GET( const parsedParams = parseBoardRouteParams(params); const result = await getClimb(parsedParams); - const litUpHoldsMap = convertLitUpHoldsStringToMap(result.frames, parsedParams.board_name); + // TODO: Multiframe support should remove the hardcoded [0] + const litUpHoldsMap = convertLitUpHoldsStringToMap(result.frames, parsedParams.board_name)[0]; if (!result) { return NextResponse.json({ error: `Failed to find problem ${params.climb_uuid}` }, { status: 404 }); diff --git a/app/components/board-renderer/util.ts b/app/components/board-renderer/util.ts index ae4d5e7..d014006 100644 --- a/app/components/board-renderer/util.ts +++ b/app/components/board-renderer/util.ts @@ -12,22 +12,36 @@ export const getImageUrl = (imageUrl: string, board: BoardName) => { return `https://api.${board}boardapp${board === 'tension' ? '2' : ''}.com/img/${imageUrl}`; }; -export const convertLitUpHoldsStringToMap = (litUpHolds: string, board: BoardName): LitUpHoldsMap => - Object.fromEntries( - litUpHolds - .split('p') - .filter((hold) => hold) - .map((holdData) => holdData.split('r').map((str) => Number(str))) - .map(([holdId, stateCode]) => { - if (!HOLD_STATE_MAP[board][stateCode]) { - throw new Error( - `HOLD_STATE_MAP is missing values for ${board} its missing statuscode: ${stateCode}. - You probably need to update that mapping after adding support for more boards`, - ); - } - const { name, color, displayColor } = HOLD_STATE_MAP[board][stateCode]; - return [holdId, { state: name, color, displayColor: displayColor || color }]; - }), - ); +export const convertLitUpHoldsStringToMap = (litUpHolds: string, board: BoardName): Record => { + // Split the litUpHolds string by frame delimiter (`,`), process each frame + return litUpHolds + .split(',') + .filter((frame) => frame) // Filter out empty frames + .reduce( + (frameMap, frameString, frameIndex) => { + // Convert each frame to a LitUpHoldsMap + const frameHoldsMap = Object.fromEntries( + frameString + .split('p') + .filter((hold) => hold) // Filter out empty hold data + .map((holdData) => holdData.split('r').map((str) => Number(str))) // Extract holdId and stateCode + .map(([holdId, stateCode]) => { + if (!HOLD_STATE_MAP[board][stateCode]) { + throw new Error( + `HOLD_STATE_MAP is missing values for ${board}. Missing status code: ${stateCode}. + You probably need to update that mapping after adding support for more boards`, + ); + } + const { name, color, displayColor } = HOLD_STATE_MAP[board][stateCode]; + return [holdId, { state: name, color, displayColor: displayColor || color }]; + }), + ); + frameMap[frameIndex] = frameHoldsMap; // Map each frame's holds + return frameMap; + }, + {} as Record, + ); +}; + export const getBoardImageDimensions = (board: BoardName, firstImage: string) => BOARD_IMAGE_DIMENSIONS[board][firstImage]; diff --git a/app/lib/data-sync/aurora/shared-sync.ts b/app/lib/data-sync/aurora/shared-sync.ts index 1c97470..35f8f0b 100644 --- a/app/lib/data-sync/aurora/shared-sync.ts +++ b/app/lib/data-sync/aurora/shared-sync.ts @@ -17,6 +17,7 @@ import { SyncPutFields, } from '../../api-wrappers/sync-api-types'; import { getTable } from '../../db/queries/util/table-select'; +import { convertLitUpHoldsStringToMap } from '@/app/components/board-renderer/util'; // Define shared sync tables in correct dependency order export const SHARED_SYNC_TABLES: string[] = [ @@ -196,9 +197,12 @@ async function upsertClimbs( data: Climb[], ) { await Promise.all( - data.map((item: Climb) => { + data.map(async (item: Climb) => { const climbsSchema = getTable('climbs', board); - return db + const climbHoldsSchema = getTable('climbHolds', board); + + // Insert or update the climb + await db .insert(climbsSchema) .values({ uuid: item.uuid, @@ -242,10 +246,25 @@ async function upsertClimbs( angle: item.angle, }, }); + + const holdsByFrame = convertLitUpHoldsStringToMap(item.frames, board); + + const holdsToInsert = Object.entries(holdsByFrame).flatMap(([frameNumber, holds]) => + Object.entries(holds).map(([holdId, { state, color }]) => ({ + climbUuid: item.uuid, + frameNumber: Number(frameNumber), + holdId: Number(holdId), + holdState: state, + color, + })), + ); + + await db.insert(climbHoldsSchema).values(holdsToInsert).onConflictDoNothing(); // Avoid duplicate inserts }), ); } + async function upsertSharedTableData( db: PgTransaction, ExtractTablesWithRelations>>, boardName: BoardName, @@ -325,7 +344,7 @@ export async function syncSharedData( const syncResults = await sharedSync(board, syncParams); - console.log(`Received ${syncResults.PUT.climbs.length} climbs and ${syncResults.PUT.climb_stats.length} climb_stats`); + console.log(`Received ${syncResults.PUT?.climbs?.length} climbs and ${syncResults.PUT?.climb_stats?.length} climb_stats`); return upsertAllSharedTableData(board, syncResults); } diff --git a/app/lib/db/queries/search-climbs.ts b/app/lib/db/queries/search-climbs.ts index 1fb9c91..a494a45 100644 --- a/app/lib/db/queries/search-climbs.ts +++ b/app/lib/db/queries/search-climbs.ts @@ -114,7 +114,7 @@ export const searchClimbs = async ( const results = await baseQuery; // Transform the results into the complete Climb type - const climbs: Climb[] = results.map(({ totalCount, ...result }) => ({ + const climbs: Climb[] = results.map((result) => ({ uuid: result.uuid, setter_username: result.setter_username || '', name: result.name || '', @@ -127,7 +127,8 @@ export const searchClimbs = async ( stars: Math.round((result.quality_average || 0) * 5), difficulty_error: result.difficulty_error?.toString(), benchmark_difficulty: result.benchmark_difficulty?.toString() || null, - litUpHoldsMap: convertLitUpHoldsStringToMap(result.frames || '', params.board_name), + // TODO: Multiframe support should remove the hardcoded [0] + litUpHoldsMap: convertLitUpHoldsStringToMap(result.frames || '', params.board_name)[0], })); return { diff --git a/app/lib/db/queries/util/table-select.ts b/app/lib/db/queries/util/table-select.ts index 19bf3bd..503b6d7 100644 --- a/app/lib/db/queries/util/table-select.ts +++ b/app/lib/db/queries/util/table-select.ts @@ -30,6 +30,8 @@ import { tensionSharedSyncs, kilterUserSyncs, tensionUserSyncs, + kilterClimbHolds, + tensionClimbHolds, } from '@/lib/db/schema'; export type BoardName = 'kilter' | 'tension'; @@ -51,6 +53,7 @@ export type TableSet = { products: typeof kilterProducts | typeof tensionProducts; userSyncs: typeof kilterUserSyncs | typeof tensionUserSyncs; sharedSyncs: typeof kilterSharedSyncs | typeof tensionSharedSyncs; + climbHolds: typeof kilterClimbHolds | typeof tensionClimbHolds; }; // Create a complete mapping of all tables @@ -71,6 +74,7 @@ const BOARD_TABLES: Record = { products: kilterProducts, userSyncs: kilterUserSyncs, sharedSyncs: kilterSharedSyncs, + climbHolds: kilterClimbHolds, }, tension: { climbs: tensionClimbs, @@ -88,6 +92,7 @@ const BOARD_TABLES: Record = { products: tensionProducts, userSyncs: tensionUserSyncs, sharedSyncs: tensionSharedSyncs, + climbHolds: tensionClimbHolds, }, } as const; diff --git a/app/lib/db/schema.ts b/app/lib/db/schema.ts index c1317f2..3da90d5 100644 --- a/app/lib/db/schema.ts +++ b/app/lib/db/schema.ts @@ -642,6 +642,60 @@ export const tensionClimbs = pgTable( }), ); +export const kilterClimbHolds = pgTable( + 'kilter_climb_holds', + { + climbUuid: text('climb_uuid').notNull(), + holdId: integer('hold_id').notNull(), + frameNumber: integer('frame_number').notNull(), + holdState: text('hold_state').notNull(), // STARTING, HAND, FINISH, FOOT + createdAt: timestamp('created_at').defaultNow(), + }, + (table) => ({ + // Primary key on both columns to ensure no duplicate holds per climb + pk: primaryKey({ columns: [table.climbUuid, table.holdId] }), + + // Index for efficient hold searches + holdSearchIdx: index('kilter_climb_holds_search_idx').on(table.holdId, table.holdState), + + // Foreign key to climbs table + climbFkey: foreignKey({ + columns: [table.climbUuid], + foreignColumns: [kilterClimbs.uuid], + name: 'kilter_climb_holds_climb_uuid_fkey', + }) + .onUpdate('cascade') + .onDelete('cascade'), + }), +); + +export const tensionClimbHolds = pgTable( + 'tension_climb_holds', + { + climbUuid: text('climb_uuid').notNull(), + holdId: integer('hold_id').notNull(), + frameNumber: integer('frame_number').notNull(), + holdState: text('hold_state').notNull(), // STARTING, HAND, FINISH, FOOT + createdAt: timestamp('created_at').defaultNow(), + }, + (table) => ({ + // Primary key on both columns to ensure no duplicate holds per climb + pk: primaryKey({ columns: [table.climbUuid, table.holdId] }), + + // Index for efficient hold searches + holdSearchIdx: index('tension_climb_holds_search_idx').on(table.holdId, table.holdState), + + // Foreign key to climbs table + climbFkey: foreignKey({ + columns: [table.climbUuid], + foreignColumns: [tensionClimbs.uuid], + name: 'tension_climb_holds_climb_uuid_fkey', + }) + .onUpdate('cascade') + .onDelete('cascade'), + }), +); + export const tensionSets = pgTable('tension_sets', { id: integer().primaryKey().notNull(), name: text(), diff --git a/drizzle/0011_add_holds_map_table.sql b/drizzle/0011_add_holds_map_table.sql new file mode 100644 index 0000000..00b55f1 --- /dev/null +++ b/drizzle/0011_add_holds_map_table.sql @@ -0,0 +1,112 @@ +CREATE TABLE "kilter_climb_holds" ( + "climb_uuid" text NOT NULL, + "frame_number" integer NOT NULL DEFAULT 0, + "hold_id" integer NOT NULL, + "hold_state" text NOT NULL, + "created_at" timestamp DEFAULT now(), + CONSTRAINT "kilter_climb_holds_climb_uuid_frame_number_hold_id_pk" PRIMARY KEY("climb_uuid", "frame_number", "hold_id") +); +--> statement-breakpoint +CREATE TABLE "tension_climb_holds" ( + "climb_uuid" text NOT NULL, + "frame_number" integer NOT NULL DEFAULT 0, + "hold_id" integer NOT NULL, + "hold_state" text NOT NULL, + "created_at" timestamp DEFAULT now(), + CONSTRAINT "tension_climb_holds_climb_uuid_frame_number_hold_id_pk" PRIMARY KEY("climb_uuid", "frame_number", "hold_id") +); +--> statement-breakpoint +ALTER TABLE "kilter_climb_holds" ADD CONSTRAINT "kilter_climb_holds_climb_uuid_fkey" FOREIGN KEY ("climb_uuid") REFERENCES "public"."kilter_climbs"("uuid") ON DELETE cascade ON UPDATE cascade; +--> statement-breakpoint +ALTER TABLE "tension_climb_holds" ADD CONSTRAINT "tension_climb_holds_climb_uuid_fkey" FOREIGN KEY ("climb_uuid") REFERENCES "public"."tension_climbs"("uuid") ON DELETE cascade ON UPDATE cascade; +--> statement-breakpoint +CREATE INDEX "kilter_climb_holds_search_idx" ON "kilter_climb_holds" USING btree ("hold_id", "hold_state"); +--> statement-breakpoint +CREATE INDEX "tension_climb_holds_search_idx" ON "tension_climb_holds" USING btree ("hold_id", "hold_state"); +--> statement-breakpoint +INSERT INTO "kilter_climb_holds" ("climb_uuid", "frame_number", "hold_id", "hold_state") +WITH parsed_holds AS ( + SELECT + "uuid" as "climb_uuid", + CASE WHEN "frames_count" = 1 THEN 0 + ELSE (array_position(regexp_split_to_array("frames", ','), frame_part) - 1) + END as "frame_number", + SUBSTRING(hold_data, '(\d+)[rx]')::INTEGER as "hold_id", + CASE + WHEN hold_data ~ 'x\d+$' THEN 'OFF' + ELSE + CASE SUBSTRING(hold_data, 'r(\d+)')::INTEGER + WHEN 12 THEN 'STARTING' + WHEN 13 THEN 'HAND' + WHEN 14 THEN 'FINISH' + WHEN 15 THEN 'FOOT' + WHEN 42 THEN 'STARTING' + WHEN 43 THEN 'HAND' + WHEN 44 THEN 'FINISH' + WHEN 45 THEN 'FOOT' + END + END as "hold_state", + -- Add priority (r patterns take precedence over x) + CASE WHEN hold_data ~ 'r\d+$' THEN 0 ELSE 1 END as priority + FROM kilter_climbs, + regexp_split_to_table("frames", ',') WITH ORDINALITY as f(frame_part, frame_ord), + regexp_split_to_table(frame_part, 'p') WITH ORDINALITY as t(hold_data, ord) + WHERE hold_data != '' + AND hold_data != '""' + AND ( + hold_data ~ '^\d+r(12|13|14|15|42|43|44|45)$' + OR hold_data ~ '^\d+x\d+$' + ) + AND layout_id IN (1, 8) +) +SELECT DISTINCT ON (climb_uuid, frame_number, hold_id) + climb_uuid, + frame_number, + hold_id, + hold_state +FROM parsed_holds +ORDER BY climb_uuid, frame_number, hold_id, priority; + + +--> statement-breakpoint +INSERT INTO "tension_climb_holds" ("climb_uuid", "frame_number", "hold_id", "hold_state") +WITH parsed_holds AS ( + SELECT + "uuid" as "climb_uuid", + CASE + WHEN "frames_count" = 1 THEN 0 + ELSE (array_position(regexp_split_to_array("frames", ','), frame_part) - 1) + END as "frame_number", + SUBSTRING(hold_data, '^(\d+)r')::INTEGER as "hold_id", + CASE + WHEN hold_data ~ 'r\d+$' THEN + CASE SUBSTRING(hold_data, 'r(\d+)$')::INTEGER + WHEN 1 THEN 'STARTING' + WHEN 2 THEN 'HAND' + WHEN 3 THEN 'FINISH' + WHEN 4 THEN 'FOOT' + WHEN 5 THEN 'STARTING' + WHEN 6 THEN 'HAND' + WHEN 7 THEN 'FINISH' + WHEN 8 THEN 'FOOT' + ELSE 'UNKNOWN' + END + ELSE 'UNKNOWN' + END as "hold_state", + CASE WHEN hold_data ~ 'r\d+$' THEN 0 ELSE 1 END as priority + FROM tension_climbs, + regexp_split_to_table("frames", ',') WITH ORDINALITY as f(frame_part, frame_ord), + regexp_split_to_table(frame_part, 'p') as t(hold_data) + WHERE hold_data != '' + AND hold_data != '""' +) +SELECT DISTINCT ON (climb_uuid, frame_number, hold_id) + climb_uuid, + frame_number, + hold_id, + hold_state +FROM parsed_holds +WHERE hold_id IS NOT NULL +ORDER BY climb_uuid, frame_number, hold_id, priority; + + diff --git a/drizzle/meta/0011_snapshot.json b/drizzle/meta/0011_snapshot.json new file mode 100644 index 0000000..8b31b69 --- /dev/null +++ b/drizzle/meta/0011_snapshot.json @@ -0,0 +1,4222 @@ +{ + "id": "b372ecf4-d48f-49a7-9dab-77ab69e42854", + "prevId": "4e18a49a-405e-42fd-88ad-a9dbbf488ccb", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.kilter_android_metadata": { + "name": "kilter_android_metadata", + "schema": "", + "columns": { + "locale": { + "name": "locale", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_ascents": { + "name": "kilter_ascents", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_mirror": { + "name": "is_mirror", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "attempt_id": { + "name": "attempt_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "bid_count": { + "name": "bid_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "quality": { + "name": "quality", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "difficulty": { + "name": "difficulty", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_benchmark": { + "name": "is_benchmark", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "climbed_at": { + "name": "climbed_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "ascents_attempt_id_fkey1": { + "name": "ascents_attempt_id_fkey1", + "tableFrom": "kilter_ascents", + "tableTo": "kilter_attempts", + "columnsFrom": [ + "attempt_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "ascents_climb_uuid_fkey1": { + "name": "ascents_climb_uuid_fkey1", + "tableFrom": "kilter_ascents", + "tableTo": "kilter_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "ascents_difficulty_fkey1": { + "name": "ascents_difficulty_fkey1", + "tableFrom": "kilter_ascents", + "tableTo": "kilter_difficulty_grades", + "columnsFrom": [ + "difficulty" + ], + "columnsTo": [ + "difficulty" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "ascents_user_id_fkey1": { + "name": "ascents_user_id_fkey1", + "tableFrom": "kilter_ascents", + "tableTo": "kilter_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_attempts": { + "name": "kilter_attempts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_beta_links": { + "name": "kilter_beta_links", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "foreign_username": { + "name": "foreign_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "thumbnail": { + "name": "thumbnail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "beta_links_climb_uuid_fkey1": { + "name": "beta_links_climb_uuid_fkey1", + "tableFrom": "kilter_beta_links", + "tableTo": "kilter_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_bids": { + "name": "kilter_bids", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_mirror": { + "name": "is_mirror", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "bid_count": { + "name": "bid_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "climbed_at": { + "name": "climbed_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "bids_climb_uuid_fkey1": { + "name": "bids_climb_uuid_fkey1", + "tableFrom": "kilter_bids", + "tableTo": "kilter_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "bids_user_id_fkey1": { + "name": "bids_user_id_fkey1", + "tableFrom": "kilter_bids", + "tableTo": "kilter_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_circuits": { + "name": "kilter_circuits", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_circuits_climbs": { + "name": "kilter_circuits_climbs", + "schema": "", + "columns": { + "circuit_uuid": { + "name": "circuit_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_climb_cache_fields": { + "name": "kilter_climb_cache_fields", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ascensionist_count": { + "name": "ascensionist_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "display_difficulty": { + "name": "display_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "quality_average": { + "name": "quality_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "climb_cache_fields_climb_uuid_fkey1": { + "name": "climb_cache_fields_climb_uuid_fkey1", + "tableFrom": "kilter_climb_cache_fields", + "tableTo": "kilter_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_climb_holds": { + "name": "kilter_climb_holds", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hold_id": { + "name": "hold_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "hold_state": { + "name": "hold_state", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "kilter_climb_holds_search_idx": { + "name": "kilter_climb_holds_search_idx", + "columns": [ + { + "expression": "hold_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "hold_state", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "kilter_climb_holds_climb_uuid_fkey": { + "name": "kilter_climb_holds_climb_uuid_fkey", + "tableFrom": "kilter_climb_holds", + "tableTo": "kilter_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "kilter_climb_holds_climb_uuid_hold_id_pk": { + "name": "kilter_climb_holds_climb_uuid_hold_id_pk", + "columns": [ + "climb_uuid", + "hold_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_climb_random_positions": { + "name": "kilter_climb_random_positions", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_climb_stats": { + "name": "kilter_climb_stats", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "display_difficulty": { + "name": "display_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "benchmark_difficulty": { + "name": "benchmark_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "ascensionist_count": { + "name": "ascensionist_count", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "difficulty_average": { + "name": "difficulty_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "quality_average": { + "name": "quality_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "fa_username": { + "name": "fa_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fa_at": { + "name": "fa_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "kilter_climb_stats_pk": { + "name": "kilter_climb_stats_pk", + "columns": [ + "climb_uuid", + "angle" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_climb_stats_history": { + "name": "kilter_climb_stats_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "display_difficulty": { + "name": "display_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "benchmark_difficulty": { + "name": "benchmark_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "ascensionist_count": { + "name": "ascensionist_count", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "difficulty_average": { + "name": "difficulty_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "quality_average": { + "name": "quality_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "fa_username": { + "name": "fa_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fa_at": { + "name": "fa_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_climbs": { + "name": "kilter_climbs", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "setter_id": { + "name": "setter_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "setter_username": { + "name": "setter_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_left": { + "name": "edge_left", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_right": { + "name": "edge_right", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_bottom": { + "name": "edge_bottom", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_top": { + "name": "edge_top", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "frames_count": { + "name": "frames_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "frames_pace": { + "name": "frames_pace", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "frames": { + "name": "frames", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_draft": { + "name": "is_draft", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "kilter_climbs_layout_filter_idx": { + "name": "kilter_climbs_layout_filter_idx", + "columns": [ + { + "expression": "layout_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_listed", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_draft", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "frames_count", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kilter_climbs_edges_idx": { + "name": "kilter_climbs_edges_idx", + "columns": [ + { + "expression": "edge_left", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "edge_right", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "edge_bottom", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "edge_top", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "climbs_layout_id_fkey1": { + "name": "climbs_layout_id_fkey1", + "tableFrom": "kilter_climbs", + "tableTo": "kilter_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_difficulty_grades": { + "name": "kilter_difficulty_grades", + "schema": "", + "columns": { + "difficulty": { + "name": "difficulty", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "boulder_name": { + "name": "boulder_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "route_name": { + "name": "route_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_holes": { + "name": "kilter_holes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "x": { + "name": "x", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "y": { + "name": "y", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mirrored_hole_id": { + "name": "mirrored_hole_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mirror_group": { + "name": "mirror_group", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "holes_product_id_fkey1": { + "name": "holes_product_id_fkey1", + "tableFrom": "kilter_holes", + "tableTo": "kilter_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_kits": { + "name": "kilter_kits", + "schema": "", + "columns": { + "serial_number": { + "name": "serial_number", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_autoconnect": { + "name": "is_autoconnect", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_layouts": { + "name": "kilter_layouts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "instagram_caption": { + "name": "instagram_caption", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_mirrored": { + "name": "is_mirrored", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "layouts_product_id_fkey1": { + "name": "layouts_product_id_fkey1", + "tableFrom": "kilter_layouts", + "tableTo": "kilter_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_leds": { + "name": "kilter_leds", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hole_id": { + "name": "hole_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "leds_hole_id_fkey1": { + "name": "leds_hole_id_fkey1", + "tableFrom": "kilter_leds", + "tableTo": "kilter_holes", + "columnsFrom": [ + "hole_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "leds_product_size_id_fkey1": { + "name": "leds_product_size_id_fkey1", + "tableFrom": "kilter_leds", + "tableTo": "kilter_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_placement_roles": { + "name": "kilter_placement_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "full_name": { + "name": "full_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "led_color": { + "name": "led_color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screen_color": { + "name": "screen_color", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "placement_roles_product_id_fkey1": { + "name": "placement_roles_product_id_fkey1", + "tableFrom": "kilter_placement_roles", + "tableTo": "kilter_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_placements": { + "name": "kilter_placements", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hole_id": { + "name": "hole_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "default_placement_role_id": { + "name": "default_placement_role_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "placements_default_placement_role_id_fkey1": { + "name": "placements_default_placement_role_id_fkey1", + "tableFrom": "kilter_placements", + "tableTo": "kilter_placement_roles", + "columnsFrom": [ + "default_placement_role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "placements_hole_id_fkey1": { + "name": "placements_hole_id_fkey1", + "tableFrom": "kilter_placements", + "tableTo": "kilter_holes", + "columnsFrom": [ + "hole_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "placements_layout_id_fkey1": { + "name": "placements_layout_id_fkey1", + "tableFrom": "kilter_placements", + "tableTo": "kilter_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "placements_set_id_fkey1": { + "name": "placements_set_id_fkey1", + "tableFrom": "kilter_placements", + "tableTo": "kilter_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_product_sizes": { + "name": "kilter_product_sizes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_left": { + "name": "edge_left", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_right": { + "name": "edge_right", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_bottom": { + "name": "edge_bottom", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_top": { + "name": "edge_top", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "image_filename": { + "name": "image_filename", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "product_sizes_product_id_fkey1": { + "name": "product_sizes_product_id_fkey1", + "tableFrom": "kilter_product_sizes", + "tableTo": "kilter_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_product_sizes_layouts_sets": { + "name": "kilter_product_sizes_layouts_sets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "image_filename": { + "name": "image_filename", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "product_sizes_layouts_sets_layout_id_fkey1": { + "name": "product_sizes_layouts_sets_layout_id_fkey1", + "tableFrom": "kilter_product_sizes_layouts_sets", + "tableTo": "kilter_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "product_sizes_layouts_sets_product_size_id_fkey1": { + "name": "product_sizes_layouts_sets_product_size_id_fkey1", + "tableFrom": "kilter_product_sizes_layouts_sets", + "tableTo": "kilter_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "product_sizes_layouts_sets_set_id_fkey1": { + "name": "product_sizes_layouts_sets_set_id_fkey1", + "tableFrom": "kilter_product_sizes_layouts_sets", + "tableTo": "kilter_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_products": { + "name": "kilter_products", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "min_count_in_frame": { + "name": "min_count_in_frame", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_count_in_frame": { + "name": "max_count_in_frame", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_products_angles": { + "name": "kilter_products_angles", + "schema": "", + "columns": { + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "products_angles_product_id_fkey1": { + "name": "products_angles_product_id_fkey1", + "tableFrom": "kilter_products_angles", + "tableTo": "kilter_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_sets": { + "name": "kilter_sets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_shared_syncs": { + "name": "kilter_shared_syncs", + "schema": "", + "columns": { + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_tags": { + "name": "kilter_tags", + "schema": "", + "columns": { + "entity_uuid": { + "name": "entity_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_user_permissions": { + "name": "kilter_user_permissions", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_user_syncs": { + "name": "kilter_user_syncs", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_syncs_user_id_fkey1": { + "name": "user_syncs_user_id_fkey1", + "tableFrom": "kilter_user_syncs", + "tableTo": "kilter_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "kilter_user_sync_pk": { + "name": "kilter_user_sync_pk", + "columns": [ + "user_id", + "table_name" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_users": { + "name": "kilter_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_walls": { + "name": "kilter_walls", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "serial_number": { + "name": "serial_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "walls_layout_id_fkey1": { + "name": "walls_layout_id_fkey1", + "tableFrom": "kilter_walls", + "tableTo": "kilter_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_id_fkey1": { + "name": "walls_product_id_fkey1", + "tableFrom": "kilter_walls", + "tableTo": "kilter_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_size_id_fkey1": { + "name": "walls_product_size_id_fkey1", + "tableFrom": "kilter_walls", + "tableTo": "kilter_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_user_id_fkey1": { + "name": "walls_user_id_fkey1", + "tableFrom": "kilter_walls", + "tableTo": "kilter_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.kilter_walls_sets": { + "name": "kilter_walls_sets", + "schema": "", + "columns": { + "wall_uuid": { + "name": "wall_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "walls_sets_set_id_fkey1": { + "name": "walls_sets_set_id_fkey1", + "tableFrom": "kilter_walls_sets", + "tableTo": "kilter_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_sets_wall_uuid_fkey1": { + "name": "walls_sets_wall_uuid_fkey1", + "tableFrom": "kilter_walls_sets", + "tableTo": "kilter_walls", + "columnsFrom": [ + "wall_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_android_metadata": { + "name": "tension_android_metadata", + "schema": "", + "columns": { + "locale": { + "name": "locale", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_ascents": { + "name": "tension_ascents", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_mirror": { + "name": "is_mirror", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "attempt_id": { + "name": "attempt_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "bid_count": { + "name": "bid_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "quality": { + "name": "quality", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "difficulty": { + "name": "difficulty", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_benchmark": { + "name": "is_benchmark", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "climbed_at": { + "name": "climbed_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "ascents_attempt_id_fkey": { + "name": "ascents_attempt_id_fkey", + "tableFrom": "tension_ascents", + "tableTo": "tension_attempts", + "columnsFrom": [ + "attempt_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "ascents_climb_uuid_fkey": { + "name": "ascents_climb_uuid_fkey", + "tableFrom": "tension_ascents", + "tableTo": "tension_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "ascents_difficulty_fkey": { + "name": "ascents_difficulty_fkey", + "tableFrom": "tension_ascents", + "tableTo": "tension_difficulty_grades", + "columnsFrom": [ + "difficulty" + ], + "columnsTo": [ + "difficulty" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "ascents_user_id_fkey": { + "name": "ascents_user_id_fkey", + "tableFrom": "tension_ascents", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_attempts": { + "name": "tension_attempts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_beta_links": { + "name": "tension_beta_links", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "foreign_username": { + "name": "foreign_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "thumbnail": { + "name": "thumbnail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "beta_links_climb_uuid_fkey": { + "name": "beta_links_climb_uuid_fkey", + "tableFrom": "tension_beta_links", + "tableTo": "tension_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_bids": { + "name": "tension_bids", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_mirror": { + "name": "is_mirror", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "bid_count": { + "name": "bid_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "climbed_at": { + "name": "climbed_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "bids_climb_uuid_fkey": { + "name": "bids_climb_uuid_fkey", + "tableFrom": "tension_bids", + "tableTo": "tension_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "bids_user_id_fkey": { + "name": "bids_user_id_fkey", + "tableFrom": "tension_bids", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_circuits": { + "name": "tension_circuits", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_circuits_climbs": { + "name": "tension_circuits_climbs", + "schema": "", + "columns": { + "circuit_uuid": { + "name": "circuit_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_climb_cache_fields": { + "name": "tension_climb_cache_fields", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ascensionist_count": { + "name": "ascensionist_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "display_difficulty": { + "name": "display_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "quality_average": { + "name": "quality_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "climb_cache_fields_climb_uuid_fkey": { + "name": "climb_cache_fields_climb_uuid_fkey", + "tableFrom": "tension_climb_cache_fields", + "tableTo": "tension_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_climb_holds": { + "name": "tension_climb_holds", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hold_id": { + "name": "hold_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "hold_state": { + "name": "hold_state", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tension_climb_holds_search_idx": { + "name": "tension_climb_holds_search_idx", + "columns": [ + { + "expression": "hold_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "hold_state", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tension_climb_holds_climb_uuid_fkey": { + "name": "tension_climb_holds_climb_uuid_fkey", + "tableFrom": "tension_climb_holds", + "tableTo": "tension_climbs", + "columnsFrom": [ + "climb_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "tension_climb_holds_climb_uuid_hold_id_pk": { + "name": "tension_climb_holds_climb_uuid_hold_id_pk", + "columns": [ + "climb_uuid", + "hold_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_climb_random_positions": { + "name": "tension_climb_random_positions", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_climb_stats": { + "name": "tension_climb_stats", + "schema": "", + "columns": { + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "display_difficulty": { + "name": "display_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "benchmark_difficulty": { + "name": "benchmark_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "ascensionist_count": { + "name": "ascensionist_count", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "difficulty_average": { + "name": "difficulty_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "quality_average": { + "name": "quality_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "fa_username": { + "name": "fa_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fa_at": { + "name": "fa_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "tension_climb_stats_pk": { + "name": "tension_climb_stats_pk", + "columns": [ + "climb_uuid", + "angle" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_climb_stats_history": { + "name": "tension_climb_stats_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "climb_uuid": { + "name": "climb_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "display_difficulty": { + "name": "display_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "benchmark_difficulty": { + "name": "benchmark_difficulty", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "ascensionist_count": { + "name": "ascensionist_count", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "difficulty_average": { + "name": "difficulty_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "quality_average": { + "name": "quality_average", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "fa_username": { + "name": "fa_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fa_at": { + "name": "fa_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_climbs": { + "name": "tension_climbs", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "setter_id": { + "name": "setter_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "setter_username": { + "name": "setter_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_left": { + "name": "edge_left", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_right": { + "name": "edge_right", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_bottom": { + "name": "edge_bottom", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_top": { + "name": "edge_top", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "frames_count": { + "name": "frames_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "frames_pace": { + "name": "frames_pace", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "frames": { + "name": "frames", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_draft": { + "name": "is_draft", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tension_climbs_layout_filter_idx": { + "name": "tension_climbs_layout_filter_idx", + "columns": [ + { + "expression": "layout_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_listed", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_draft", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "frames_count", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tension_climbs_edges_idx": { + "name": "tension_climbs_edges_idx", + "columns": [ + { + "expression": "edge_left", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "edge_right", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "edge_bottom", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "edge_top", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "climbs_layout_id_fkey": { + "name": "climbs_layout_id_fkey", + "tableFrom": "tension_climbs", + "tableTo": "tension_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_difficulty_grades": { + "name": "tension_difficulty_grades", + "schema": "", + "columns": { + "difficulty": { + "name": "difficulty", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "boulder_name": { + "name": "boulder_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "route_name": { + "name": "route_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_holes": { + "name": "tension_holes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "x": { + "name": "x", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "y": { + "name": "y", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mirrored_hole_id": { + "name": "mirrored_hole_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mirror_group": { + "name": "mirror_group", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "holes_mirrored_hole_id_fkey": { + "name": "holes_mirrored_hole_id_fkey", + "tableFrom": "tension_holes", + "tableTo": "tension_holes", + "columnsFrom": [ + "mirrored_hole_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "holes_product_id_fkey": { + "name": "holes_product_id_fkey", + "tableFrom": "tension_holes", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_kits": { + "name": "tension_kits", + "schema": "", + "columns": { + "serial_number": { + "name": "serial_number", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_autoconnect": { + "name": "is_autoconnect", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_layouts": { + "name": "tension_layouts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "instagram_caption": { + "name": "instagram_caption", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_mirrored": { + "name": "is_mirrored", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "layouts_product_id_fkey": { + "name": "layouts_product_id_fkey", + "tableFrom": "tension_layouts", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_leds": { + "name": "tension_leds", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hole_id": { + "name": "hole_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "leds_hole_id_fkey": { + "name": "leds_hole_id_fkey", + "tableFrom": "tension_leds", + "tableTo": "tension_holes", + "columnsFrom": [ + "hole_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "leds_product_size_id_fkey": { + "name": "leds_product_size_id_fkey", + "tableFrom": "tension_leds", + "tableTo": "tension_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_placement_roles": { + "name": "tension_placement_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "full_name": { + "name": "full_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "led_color": { + "name": "led_color", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screen_color": { + "name": "screen_color", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "placement_roles_product_id_fkey": { + "name": "placement_roles_product_id_fkey", + "tableFrom": "tension_placement_roles", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_placements": { + "name": "tension_placements", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hole_id": { + "name": "hole_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "default_placement_role_id": { + "name": "default_placement_role_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "placements_default_placement_role_id_fkey": { + "name": "placements_default_placement_role_id_fkey", + "tableFrom": "tension_placements", + "tableTo": "tension_placement_roles", + "columnsFrom": [ + "default_placement_role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "placements_hole_id_fkey": { + "name": "placements_hole_id_fkey", + "tableFrom": "tension_placements", + "tableTo": "tension_holes", + "columnsFrom": [ + "hole_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "placements_layout_id_fkey": { + "name": "placements_layout_id_fkey", + "tableFrom": "tension_placements", + "tableTo": "tension_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "placements_set_id_fkey": { + "name": "placements_set_id_fkey", + "tableFrom": "tension_placements", + "tableTo": "tension_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_product_sizes": { + "name": "tension_product_sizes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_left": { + "name": "edge_left", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_right": { + "name": "edge_right", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_bottom": { + "name": "edge_bottom", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "edge_top": { + "name": "edge_top", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "image_filename": { + "name": "image_filename", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "product_sizes_product_id_fkey": { + "name": "product_sizes_product_id_fkey", + "tableFrom": "tension_product_sizes", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_product_sizes_layouts_sets": { + "name": "tension_product_sizes_layouts_sets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "image_filename": { + "name": "image_filename", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "product_sizes_layouts_sets_layout_id_fkey": { + "name": "product_sizes_layouts_sets_layout_id_fkey", + "tableFrom": "tension_product_sizes_layouts_sets", + "tableTo": "tension_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "product_sizes_layouts_sets_product_size_id_fkey": { + "name": "product_sizes_layouts_sets_product_size_id_fkey", + "tableFrom": "tension_product_sizes_layouts_sets", + "tableTo": "tension_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "product_sizes_layouts_sets_set_id_fkey": { + "name": "product_sizes_layouts_sets_set_id_fkey", + "tableFrom": "tension_product_sizes_layouts_sets", + "tableTo": "tension_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_products": { + "name": "tension_products", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "min_count_in_frame": { + "name": "min_count_in_frame", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_count_in_frame": { + "name": "max_count_in_frame", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_products_angles": { + "name": "tension_products_angles", + "schema": "", + "columns": { + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "products_angles_product_id_fkey": { + "name": "products_angles_product_id_fkey", + "tableFrom": "tension_products_angles", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_sets": { + "name": "tension_sets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_shared_syncs": { + "name": "tension_shared_syncs", + "schema": "", + "columns": { + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_tags": { + "name": "tension_tags", + "schema": "", + "columns": { + "entity_uuid": { + "name": "entity_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_user_permissions": { + "name": "tension_user_permissions", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_user_syncs": { + "name": "tension_user_syncs", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_syncs_user_id_fkey": { + "name": "user_syncs_user_id_fkey", + "tableFrom": "tension_user_syncs", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "tension_user_sync_pk": { + "name": "tension_user_sync_pk", + "columns": [ + "user_id", + "table_name" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_users": { + "name": "tension_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_walls": { + "name": "tension_walls", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "serial_number": { + "name": "serial_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "walls_layout_id_fkey": { + "name": "walls_layout_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_id_fkey": { + "name": "walls_product_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_size_id_fkey": { + "name": "walls_product_size_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_user_id_fkey": { + "name": "walls_user_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_walls_sets": { + "name": "tension_walls_sets", + "schema": "", + "columns": { + "wall_uuid": { + "name": "wall_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "walls_sets_set_id_fkey": { + "name": "walls_sets_set_id_fkey", + "tableFrom": "tension_walls_sets", + "tableTo": "tension_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_sets_wall_uuid_fkey": { + "name": "walls_sets_wall_uuid_fkey", + "tableFrom": "tension_walls_sets", + "tableTo": "tension_walls", + "columnsFrom": [ + "wall_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 5f0e946..6691754 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -78,6 +78,13 @@ "when": 1735526364141, "tag": "0010_remove_stats_foreignkeys", "breakpoints": true + }, + { + "idx": 11, + "version": "7", + "when": 1735770051923, + "tag": "0011_add_holds_map_table", + "breakpoints": true } ] } \ No newline at end of file