From 23be288dbce0f2d2b1a87d175ff9b93166ec5d0a Mon Sep 17 00:00:00 2001 From: Marco de Jongh <1107647+marcodejongh@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:54:27 +1100 Subject: [PATCH 1/4] Add onHoldClick to BoardLitUpholds when a onHoldClick handler is specified it's called whenever a hold is clicked this can be used to implement the create climb and search by climb experiences in the UI. The state for what holds are active should still be manage doutside of the board-renderer --- .../board-renderer/board-litup-holds.tsx | 66 ++++++++++--------- .../board-renderer/board-renderer.tsx | 13 ++-- .../climb-card/climb-card-cover.tsx | 2 +- app/components/climb-card/climb-thumbnail.tsx | 2 +- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/app/components/board-renderer/board-litup-holds.tsx b/app/components/board-renderer/board-litup-holds.tsx index 9cc8eb1..89d4bfc 100644 --- a/app/components/board-renderer/board-litup-holds.tsx +++ b/app/components/board-renderer/board-litup-holds.tsx @@ -1,51 +1,57 @@ import React from 'react'; -import { HoldRenderData } from './types'; -import { Climb } from '@/app/lib/types'; +import { HoldRenderData, LitUpHoldsMap } from './types'; interface BoardLitupHoldsProps { holdsData: HoldRenderData[]; - climb: Climb; + litUpHoldsMap: LitUpHoldsMap; + mirrored: boolean; thumbnail?: boolean; + onHoldClick?: (holdId: number) => void; } const BoardLitupHolds: React.FC = ({ holdsData, - climb: { litUpHoldsMap, mirrored }, + litUpHoldsMap, + mirrored, thumbnail, + onHoldClick }) => { if (!holdsData) return null; return ( <> - {holdsData - .filter(({ id }) => litUpHoldsMap[id]?.state && litUpHoldsMap[id].state !== 'OFF') // Apply the lit-up state - .map((hold) => { - const color = litUpHoldsMap[hold.id].color; - if (mirrored) { - const mirroredHold = holdsData.find(({ id }) => id === hold.mirroredHoldId); - if (!mirroredHold) { - throw new Error("Couldn't find mirrored hold"); - } - hold = mirroredHold; + {holdsData.map((hold) => { + const isLitUp = litUpHoldsMap[hold.id]?.state && litUpHoldsMap[hold.id].state !== 'OFF'; + const color = isLitUp ? litUpHoldsMap[hold.id].color : 'transparent'; + + let renderHold = hold; + if (mirrored && hold.mirroredHoldId) { + const mirroredHold = holdsData.find(({ id }) => id === hold.mirroredHoldId); + if (!mirroredHold) { + throw new Error("Couldn't find mirrored hold"); } + renderHold = mirroredHold; + } - return ( - - ); - })} + return ( + onHoldClick(renderHold.id) : undefined} + /> + ); + })} ); }; -export default BoardLitupHolds; +export default BoardLitupHolds; \ No newline at end of file diff --git a/app/components/board-renderer/board-renderer.tsx b/app/components/board-renderer/board-renderer.tsx index accd6ee..ab28f1f 100644 --- a/app/components/board-renderer/board-renderer.tsx +++ b/app/components/board-renderer/board-renderer.tsx @@ -1,17 +1,20 @@ import React from 'react'; import { getImageUrl } from './util'; -import { BoardDetails, Climb } from '@/app/lib/types'; +import { BoardDetails } from '@/app/lib/types'; import BoardLitupHolds from './board-litup-holds'; +import { LitUpHoldsMap } from './types'; export type BoardProps = { boardDetails: BoardDetails; - climb?: Climb; + litUpHoldsMap?: LitUpHoldsMap; + mirrored: boolean; thumbnail?: boolean; + onHoldClick?: (holdId: number) => void; }; -const BoardRenderer = ({ boardDetails, thumbnail, climb }: BoardProps) => { +const BoardRenderer = ({ boardDetails, thumbnail, litUpHoldsMap, mirrored, onHoldClick }: BoardProps) => { const { boardWidth, boardHeight, holdsData } = boardDetails; - + return ( { {Object.keys(boardDetails.images_to_holds).map((imageUrl) => ( ))} - {climb && climb.litUpHoldsMap && } + {litUpHoldsMap && } ); }; diff --git a/app/components/climb-card/climb-card-cover.tsx b/app/components/climb-card/climb-card-cover.tsx index 33ee5cf..af5ab80 100644 --- a/app/components/climb-card/climb-card-cover.tsx +++ b/app/components/climb-card/climb-card-cover.tsx @@ -24,7 +24,7 @@ const ClimbCardCover = ({ climb, boardDetails, onClick }: ClimbCardCoverProps) = cursor: 'pointer', }} > - + setModalOpen(false)} diff --git a/app/components/climb-card/climb-thumbnail.tsx b/app/components/climb-card/climb-thumbnail.tsx index 165f0a1..f4bd6db 100644 --- a/app/components/climb-card/climb-thumbnail.tsx +++ b/app/components/climb-card/climb-thumbnail.tsx @@ -15,7 +15,7 @@ const ClimbThumbnail = ({ boardDetails, currentClimb }: ClimbThumbnailProps) => return ( <> setModalOpen(true) : undefined}> - + {currentClimb && ( Date: Sat, 11 Jan 2025 11:08:20 +1100 Subject: [PATCH 2/4] Get search by climb hold working --- .../[set_ids]/[angle]/list/layout.tsx | 18 +- .../[set_ids]/[angle]/[climb_uuid]/route.ts | 2 +- app/components/board-page/header.tsx | 2 +- .../board-renderer/board-litup-holds.tsx | 6 +- .../board-renderer/board-renderer.tsx | 11 +- .../climb-card/climb-card-cover.tsx | 2 +- app/components/climb-card/climb-thumbnail.tsx | 7 +- .../search-drawer/basic-search-form.tsx | 146 + .../search-drawer/climb-hold-search-form.tsx | 147 + .../search-drawer/search-button.tsx | 5 +- .../search-drawer/search-drawer.tsx | 5 +- app/components/search-drawer/search-form.tsx | 157 +- app/lib/api-wrappers/aurora/types.ts | 11 +- app/lib/api-wrappers/sync-api-types.ts | 41 +- app/lib/data-sync/aurora/shared-sync.ts | 25 +- app/lib/data-sync/aurora/user-sync.ts | 2 +- app/lib/db/queries/search-climbs.ts | 37 +- app/lib/db/relations.ts | 4 +- app/lib/db/schema.ts | 22 +- app/lib/types.ts | 12 +- app/lib/url-utils.ts | 80 +- app/sesh/page.tsx | 211 + drizzle.config.ts | 4 +- drizzle/0012_drop_climb_holds_fk.sql | 4 + drizzle/README.md | 5 +- drizzle/meta/0003_snapshot.json | 500 +-- drizzle/meta/0004_snapshot.json | 508 +-- drizzle/meta/0005_snapshot.json | 518 +-- drizzle/meta/0006_snapshot.json | 510 +-- drizzle/meta/0007_snapshot.json | 510 +-- drizzle/meta/0008_snapshot.json | 526 +-- drizzle/meta/0009_snapshot.json | 526 +-- drizzle/meta/0010_snapshot.json | 510 +-- drizzle/meta/0011_snapshot.json | 536 +-- drizzle/meta/0012_snapshot.json | 3944 +++++++++++++++++ drizzle/meta/_journal.json | 9 +- 36 files changed, 5808 insertions(+), 3755 deletions(-) create mode 100644 app/components/search-drawer/basic-search-form.tsx create mode 100644 app/components/search-drawer/climb-hold-search-form.tsx create mode 100644 app/sesh/page.tsx create mode 100644 drizzle/0012_drop_climb_holds_fk.sql create mode 100644 drizzle/meta/0012_snapshot.json diff --git a/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/layout.tsx b/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/layout.tsx index 609b618..7c1110e 100644 --- a/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/layout.tsx +++ b/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/layout.tsx @@ -6,17 +6,29 @@ import SearchColumn from '@/app/components/search-drawer/search-drawer'; import Col from 'antd/es/col'; import { Content } from 'antd/es/layout/layout'; import Row from 'antd/es/row'; +import { BoardRouteParametersWithUuid, ParsedBoardRouteParameters } from '@/app/lib/types'; +import { parseBoardRouteParams } from '@/app/lib/url-utils'; +import { fetchBoardDetails } from '@/app/components/rest-api/api'; -interface LayoutProps {} +interface LayoutProps { + params: BoardRouteParametersWithUuid; +} + +export default async function ListLayout({ children, params }: PropsWithChildren) { + const parsedParams: ParsedBoardRouteParameters = parseBoardRouteParams(params); + + const { board_name, layout_id, set_ids, size_id } = parsedParams; + + // Fetch the climbs and board details server-side + const [boardDetails] = await Promise.all([fetchBoardDetails(board_name, layout_id, size_id, set_ids)]); -export default function ListLayout({ children }: PropsWithChildren) { return ( {children} - + ); 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 f083227..67f63da 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 @@ -14,7 +14,7 @@ export async function GET( const result = await getClimb(parsedParams); // TODO: Multiframe support should remove the hardcoded [0] - const litUpHoldsMap = convertLitUpHoldsStringToMap(result.frames, parsedParams.board_name)[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-page/header.tsx b/app/components/board-page/header.tsx index 1df4a23..d03b58f 100644 --- a/app/components/board-page/header.tsx +++ b/app/components/board-page/header.tsx @@ -42,7 +42,7 @@ export default function BoardSeshHeader({ boardDetails }: BoardSeshHeaderProps) {screens.md ? null : } - {isList ? : null} + {isList ? : null} diff --git a/app/components/board-renderer/board-litup-holds.tsx b/app/components/board-renderer/board-litup-holds.tsx index 89d4bfc..44dd5e3 100644 --- a/app/components/board-renderer/board-litup-holds.tsx +++ b/app/components/board-renderer/board-litup-holds.tsx @@ -14,7 +14,7 @@ const BoardLitupHolds: React.FC = ({ litUpHoldsMap, mirrored, thumbnail, - onHoldClick + onHoldClick, }) => { if (!holdsData) return null; @@ -23,7 +23,7 @@ const BoardLitupHolds: React.FC = ({ {holdsData.map((hold) => { const isLitUp = litUpHoldsMap[hold.id]?.state && litUpHoldsMap[hold.id].state !== 'OFF'; const color = isLitUp ? litUpHoldsMap[hold.id].color : 'transparent'; - + let renderHold = hold; if (mirrored && hold.mirroredHoldId) { const mirroredHold = holdsData.find(({ id }) => id === hold.mirroredHoldId); @@ -54,4 +54,4 @@ const BoardLitupHolds: React.FC = ({ ); }; -export default BoardLitupHolds; \ No newline at end of file +export default BoardLitupHolds; diff --git a/app/components/board-renderer/board-renderer.tsx b/app/components/board-renderer/board-renderer.tsx index ab28f1f..c9dc83c 100644 --- a/app/components/board-renderer/board-renderer.tsx +++ b/app/components/board-renderer/board-renderer.tsx @@ -14,7 +14,7 @@ export type BoardProps = { const BoardRenderer = ({ boardDetails, thumbnail, litUpHoldsMap, mirrored, onHoldClick }: BoardProps) => { const { boardWidth, boardHeight, holdsData } = boardDetails; - + return ( ( ))} - {litUpHoldsMap && } + {litUpHoldsMap && ( + + )} ); }; diff --git a/app/components/climb-card/climb-card-cover.tsx b/app/components/climb-card/climb-card-cover.tsx index af5ab80..c9e8b9f 100644 --- a/app/components/climb-card/climb-card-cover.tsx +++ b/app/components/climb-card/climb-card-cover.tsx @@ -24,7 +24,7 @@ const ClimbCardCover = ({ climb, boardDetails, onClick }: ClimbCardCoverProps) = cursor: 'pointer', }} > - + setModalOpen(false)} diff --git a/app/components/climb-card/climb-thumbnail.tsx b/app/components/climb-card/climb-thumbnail.tsx index f4bd6db..d7b99d0 100644 --- a/app/components/climb-card/climb-thumbnail.tsx +++ b/app/components/climb-card/climb-thumbnail.tsx @@ -15,7 +15,12 @@ const ClimbThumbnail = ({ boardDetails, currentClimb }: ClimbThumbnailProps) => return ( <> setModalOpen(true) : undefined}> - + {currentClimb && ( { + const { uiSearchParams, updateFilters } = useUISearchParams(); + const grades = TENSION_KILTER_GRADES; + + const handleGradeChange = (type: 'min' | 'max', value: number | undefined) => { + if (type === 'min') { + updateFilters({ minGrade: value }); + } else { + updateFilters({ maxGrade: value }); + } + }; + + return ( +
+ + + + + + + + + + + + + + + + + + + + + updateFilters({ minAscents: value || undefined })} + style={{ width: '100%' }} + placeholder="Any" + /> + + + + + + + + + + + + + + + updateFilters({ minRating: value || undefined })} + style={{ width: '100%' }} + placeholder="Any" + /> + + + + + + + + + + + + updateFilters({ settername: e.target.value })} /> + +
+ ); +}; + +export default BasicSearchForm; diff --git a/app/components/search-drawer/climb-hold-search-form.tsx b/app/components/search-drawer/climb-hold-search-form.tsx new file mode 100644 index 0000000..93baf90 --- /dev/null +++ b/app/components/search-drawer/climb-hold-search-form.tsx @@ -0,0 +1,147 @@ +'use client'; +import React from 'react'; +import { BoardDetails } from '@/app/lib/types'; +import { HOLD_STATE_MAP, LitUpHoldsMap } from '../board-renderer/types'; +import BoardRenderer from '../board-renderer/board-renderer'; +import { useUISearchParams } from '@/app/components/queue-control/ui-searchparams-provider'; +import { Select } from 'antd'; + +export type HoldCode = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 42 | 43 | 44 | 45 | 12 | 13 | 14 | 15; +export type BoardName = 'tension' | 'kilter'; +export type HoldState = 'STARTING' | 'HAND' | 'FOOT' | 'FINISH' | 'OFF' | 'ANY' | 'NOT'; + +interface ClimbHoldSearchFormProps { + boardDetails: BoardDetails; +} + +const ClimbHoldSearchForm: React.FC = ({ boardDetails }) => { + const { uiSearchParams, updateFilters } = useUISearchParams(); + const [selectedState, setSelectedState] = React.useState('ANY'); + + const getStateCode = (state: HoldState, boardName: BoardName): HoldCode => { + if (state === 'ANY' || state === 'NOT') return null; + + const stateMap = HOLD_STATE_MAP[boardName]; + const entry = Object.entries(stateMap).find(([, value]) => value.name === state); + if (!entry) { + throw new Error(`No code found for state ${state} on board ${boardName}`); + } + return parseInt(entry[0]) as HoldCode; + }; + + const handleHoldClick = (holdId: number) => { + const stateCode = getStateCode(selectedState, boardDetails.board_name as BoardName); + const updates: Record = {}; + const holdKey = `hold_${holdId}`; + + // Handle ANY state (remove filter) + if (selectedState === 'ANY') { + updates[holdKey] = 'ANY'; + } + // Handle NOT state + else if (selectedState === 'NOT') { + updates[holdKey] = 'NOT'; + } + // Handle other states + else { + const currentValue = uiSearchParams[holdKey]; + if (currentValue === stateCode?.toString()) { + updates[holdKey] = undefined; + } else { + updates[holdKey] = stateCode; + } + } + + // Handle mirrored hold + const hold = boardDetails.holdsData.find((h) => h.id === holdId); + if (hold?.mirroredHoldId) { + const mirrorKey = `hold_${hold.mirroredHoldId}`; + updates[mirrorKey] = updates[holdKey]; + } + + // Create visual hold map for UI + const newSelectedHolds: LitUpHoldsMap = { ...(uiSearchParams.holdsFilter || {}) }; + if (updates[holdKey] === undefined) { + delete newSelectedHolds[holdId]; + if (hold?.mirroredHoldId) { + delete newSelectedHolds[hold.mirroredHoldId]; + } + } else { + let displayInfo; + if (selectedState === 'NOT') { + displayInfo = { + state: 'NOT', + color: '#FF0000', // Red color for NOT state + }; + } else if (selectedState === 'ANY') { + displayInfo = { + state: 'ANY', + color: '#b76e79', + }; + } else { + const stateInfo = HOLD_STATE_MAP[boardDetails.board_name as BoardName][stateCode]; + displayInfo = { + state: stateInfo.name, + color: stateInfo.displayColor || stateInfo.color, + }; + } + + if (displayInfo) { + newSelectedHolds[holdId] = displayInfo; + } + } + + updateFilters({ + holdsFilter: newSelectedHolds, + }); + }; + + const clearAllHolds = () => { + const updates: Record = {}; + + updateFilters({ + holdsFilter: {}, + }); + }; + + const stateItems = [ + { value: 'ANY', label: 'Any Hold' }, + // TODO: Shouldn't be hard to implement the other hold states + // But not sure yet if I see the point in adding those + // { value: 'STARTING', label: 'Starting Hold' }, + // { value: 'HAND', label: 'Hand Hold' }, + // { value: 'FOOT', label: 'Foot Hold' }, + // { value: 'FINISH', label: 'Finish Hold' }, + { value: 'NOT', label: 'Not This Hold' }, + ]; + + return ( +
+
+

Select hold type:

+ handleGradeChange('min', value)} - style={{ width: '100%' }} - > - Any - {grades.map((grade) => ( - - {grade.difficulty_name} - - ))} - - - - - - - - - - - - - updateFilters({ minAscents: value || undefined })} - style={{ width: '100%' }} - placeholder="Any" - /> - - - - - - - - - - - - - - - updateFilters({ minRating: value || undefined })} - style={{ width: '100%' }} - placeholder="Any" - /> - - - - - - - - - - - - updateFilters({ settername: e.target.value })} - /> - - + + + + + + + + ); }; -export default SearchForm; \ No newline at end of file +export default SearchForm; diff --git a/app/lib/api-wrappers/aurora/types.ts b/app/lib/api-wrappers/aurora/types.ts index 855d2f8..7104146 100644 --- a/app/lib/api-wrappers/aurora/types.ts +++ b/app/lib/api-wrappers/aurora/types.ts @@ -170,7 +170,16 @@ export type UserSyncData = LastSyncData & { user_id: number; }; -export const USER_TABLES = ['users', 'walls', 'wall_expungements', 'draft_climbs', 'ascents', 'bids', 'tags', 'circuits']; +export const USER_TABLES = [ + 'users', + 'walls', + 'wall_expungements', + 'draft_climbs', + 'ascents', + 'bids', + 'tags', + 'circuits', +]; export const SHARED_SYNC_TABLES = [ 'gyms', 'boards', diff --git a/app/lib/api-wrappers/sync-api-types.ts b/app/lib/api-wrappers/sync-api-types.ts index b466cb9..3669e92 100644 --- a/app/lib/api-wrappers/sync-api-types.ts +++ b/app/lib/api-wrappers/sync-api-types.ts @@ -180,26 +180,27 @@ export interface SharedSync { table_name: string; last_synchronized_at: string; } -export type SyncPutFields = User - | Wall - | WallExpungement - | Ascent - | UserSync - | Climb - | ClimbStats - | SharedSync - | Attempt - | Product - | ProductSize - | Hole - | Led - | Layout - | PlacementRole - | Set - | ProductsAngle - | BetaLink - | ProductSizesLayoutsSet; - +export type SyncPutFields = + | User + | Wall + | WallExpungement + | Ascent + | UserSync + | Climb + | ClimbStats + | SharedSync + | Attempt + | Product + | ProductSize + | Hole + | Led + | Layout + | PlacementRole + | Set + | ProductsAngle + | BetaLink + | ProductSizesLayoutsSet; + export interface SyncDataPUT extends Record> { users: User[]; walls: Wall[]; diff --git a/app/lib/data-sync/aurora/shared-sync.ts b/app/lib/data-sync/aurora/shared-sync.ts index 35f8f0b..973d5fa 100644 --- a/app/lib/data-sync/aurora/shared-sync.ts +++ b/app/lib/data-sync/aurora/shared-sync.ts @@ -264,7 +264,6 @@ async function upsertClimbs( ); } - async function upsertSharedTableData( db: PgTransaction, ExtractTablesWithRelations>>, boardName: BoardName, @@ -328,9 +327,7 @@ export async function getLastSharedSyncTimes(boardName: BoardName) { return result; } -export async function syncSharedData( - board: BoardName, -): Promise> { +export async function syncSharedData(board: BoardName): Promise> { console.log('Entered sync shared data'); const allSyncTimes = await getLastSharedSyncTimes(board); console.log('Fetched previous sync times'); @@ -344,8 +341,10 @@ 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); } @@ -365,14 +364,14 @@ const upsertAllSharedTableData = async (board: BoardName, syncResults: SyncData) // TODO: Move rest api call out of DB transaction to make error messages // easier to interpret const promises = [...SHARED_SYNC_TABLES, 'shared_syncs'] - .filter(name => syncResults.PUT[name]) - .map(async (tableName) => { - const data = syncResults.PUT[tableName]; + .filter((name) => syncResults.PUT[name]) + .map(async (tableName) => { + const data = syncResults.PUT[tableName]; - await upsertSharedTableData(tx, board, tableName, data); - console.log(`Updated ${tableName} with ${data.length} rows`); - return [tableName, { synced: data.length }]; - }); + await upsertSharedTableData(tx, board, tableName, data); + console.log(`Updated ${tableName} with ${data.length} rows`); + return [tableName, { synced: data.length }]; + }); const results = Object.fromEntries(await Promise.all(promises)); } catch (error) { //@ts-expect-error diff --git a/app/lib/data-sync/aurora/user-sync.ts b/app/lib/data-sync/aurora/user-sync.ts index 3aa6461..cd8ab6f 100644 --- a/app/lib/data-sync/aurora/user-sync.ts +++ b/app/lib/data-sync/aurora/user-sync.ts @@ -359,7 +359,7 @@ export async function syncUserData( try { // Process each table for (const tableName of tables) { - console.log(`Syncing ${tableName} for user ${userId}`) + console.log(`Syncing ${tableName} for user ${userId}`); if (syncResults.PUT && syncResults.PUT[tableName]) { const data = syncResults.PUT[tableName]; await upsertTableData(tx, board, tableName, userId, data); diff --git a/app/lib/db/queries/search-climbs.ts b/app/lib/db/queries/search-climbs.ts index a494a45..76439ff 100644 --- a/app/lib/db/queries/search-climbs.ts +++ b/app/lib/db/queries/search-climbs.ts @@ -1,4 +1,4 @@ -import { and, eq, between, gte, sql, is, desc, asc } from 'drizzle-orm'; +import { and, eq, between, gte, sql, is, desc, asc, inArray, exists, like, notLike } from 'drizzle-orm'; import { alias } from 'drizzle-orm/pg-core'; import { dbz as db } from '../db'; import { convertLitUpHoldsStringToMap } from '@/app/components/board-renderer/util'; @@ -11,13 +11,19 @@ import { } from '../../types'; import { getBoardTables } from './util/table-select'; +const getFramesLikeClause = (holds: number[]) => { + // We want to match ANY frame that contains ALL of these holds + // So we create a pattern like '%1r2p2r1p%' for holds [1,2] + return `%${holds.map((holdId) => `${holdId}r`).join('%')}%`; +}; + export const searchClimbs = async ( params: ParsedBoardRouteParameters, searchParams: SearchRequestPagination, ): Promise => { // TODO: use nicer table abstraction from shared syncs here const tables = getBoardTables(params.board_name); - + // Define sort columns with explicit SQL expressions where needed const allowedSortColumns: Record = { ascents: tables.climbStats.ascensionistCount, @@ -26,9 +32,14 @@ export const searchClimbs = async ( quality: tables.climbStats.qualityAverage, }; + const holdsToFilter = Object.entries(searchParams.holdsFilter).map(([key, state]) => [ + key.replace('hold_', ''), + state, + ]); + // Get the selected sort column or fall back to ascensionist_count const sortColumn = allowedSortColumns[searchParams.sortBy] || tables.climbStats.ascensionistCount; - + const ps = alias(tables.productSizes, 'ps'); // Build where conditions array dynamically @@ -54,13 +65,9 @@ export const searchClimbs = async ( sql`ROUND(${tables.climbStats.displayDifficulty}::numeric, 0) BETWEEN ${searchParams.minGrade} AND ${searchParams.maxGrade}`, ); } else if (searchParams.minGrade) { - whereConditions.push( - sql`ROUND(${tables.climbStats.displayDifficulty}::numeric, 0) >= ${searchParams.minGrade}`, - ); + whereConditions.push(sql`ROUND(${tables.climbStats.displayDifficulty}::numeric, 0) >= ${searchParams.minGrade}`); } else if (searchParams.maxGrade) { - whereConditions.push( - sql`ROUND(${tables.climbStats.displayDifficulty}::numeric, 0) <= ${searchParams.maxGrade}`, - ); + whereConditions.push(sql`ROUND(${tables.climbStats.displayDifficulty}::numeric, 0) <= ${searchParams.maxGrade}`); } if (searchParams.minRating) { @@ -76,6 +83,8 @@ export const searchClimbs = async ( if (searchParams.name) { whereConditions.push(sql`${tables.climbs.name} ILIKE ${`%${searchParams.name}%`}`); } + const anyHolds = holdsToFilter.filter(([, value]) => value === 'ANY').map(([key]) => Number(key)); + const notHolds = holdsToFilter.filter(([, value]) => value === 'NOT').map(([key]) => Number(key)); const baseQuery = db .select({ @@ -102,7 +111,13 @@ export const searchClimbs = async ( eq(tables.difficultyGrades.difficulty, sql`ROUND(${tables.climbStats.displayDifficulty}::numeric)`), ) .innerJoin(ps, eq(ps.id, params.size_id)) - .where(and(...whereConditions)) + .where( + and( + ...whereConditions, + ...anyHolds.map((holdId) => like(tables.climbs.frames, `%${holdId}r%`)), + ...notHolds.map((holdId) => notLike(tables.climbs.frames, `%${holdId}r%`)), + ), + ) .orderBy( searchParams.sortOrder === 'asc' ? sql`${sortColumn} ASC NULLS FIRST` : sql`${sortColumn} DESC NULLS LAST`, // Add secondary sort to ensure consistent ordering @@ -135,4 +150,4 @@ export const searchClimbs = async ( climbs: climbs, totalCount: results.length > 0 ? Number(results[0].totalCount) : 0, }; -}; \ No newline at end of file +}; diff --git a/app/lib/db/relations.ts b/app/lib/db/relations.ts index 36850f2..c12cb56 100644 --- a/app/lib/db/relations.ts +++ b/app/lib/db/relations.ts @@ -42,8 +42,8 @@ import { tensionUserSyncs, kilterBetaLinks, tensionBetaLinks, - tensionClimbStats, - kilterClimbStats, + tensionClimbStats, + kilterClimbStats, } from './schema'; export const tensionClimbStatsRelations = relations(tensionClimbStats, ({ one }) => ({ diff --git a/app/lib/db/schema.ts b/app/lib/db/schema.ts index 3da90d5..de119ba 100644 --- a/app/lib/db/schema.ts +++ b/app/lib/db/schema.ts @@ -10,7 +10,7 @@ import { timestamp, uniqueIndex, primaryKey, - index, + index, } from 'drizzle-orm/pg-core'; import { sql } from 'drizzle-orm'; @@ -657,15 +657,6 @@ export const kilterClimbHolds = pgTable( // 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'), }), ); @@ -684,15 +675,6 @@ export const tensionClimbHolds = pgTable( // 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'), }), ); @@ -1165,7 +1147,7 @@ export const kilterUserSyncs = pgTable( lastSynchronizedAt: text('last_synchronized_at'), }, (table) => [ - primaryKey({ name: 'kilter_user_sync_pk', columns: [table.userId, table.tableName] }), + primaryKey({ name: 'kilter_user_sync_pk', columns: [table.userId, table.tableName] }), foreignKey({ columns: [table.userId], foreignColumns: [kilterUsers.id], diff --git a/app/lib/types.ts b/app/lib/types.ts index a94ce91..9e802cb 100644 --- a/app/lib/types.ts +++ b/app/lib/types.ts @@ -55,6 +55,14 @@ export type SetsResponse = { }; // Search Request Type +export type HoldCode = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 42 | 43 | 44 | 45 | 12 | 13 | 14 | 15; +export type HoldState = 'STARTING' | 'HAND' | 'FOOT' | 'FINISH' | 'OFF' | 'ANY'; + +export type HoldStateFilter = { + holdId: string; + stateCode: HoldCode; +}; + export type SearchRequest = { gradeAccuracy: number; maxGrade: number; @@ -67,8 +75,7 @@ export type SearchRequest = { onlyClassics: boolean; settername: string; setternameSuggestion: string; - holds: string; - mirroredHolds: string; + holdsFilter: HoldStateFilter; }; export type SearchRequestPagination = SearchRequest & { @@ -124,7 +131,6 @@ export type SearchClimbsResult = { totalCount: number; }; - // Led Colors Type export type LedColor = { [role_id: number]: string; diff --git a/app/lib/url-utils.ts b/app/lib/url-utils.ts index 28a4b6b..17d2508 100644 --- a/app/lib/url-utils.ts +++ b/app/lib/url-utils.ts @@ -37,40 +37,42 @@ export function parseBoardRouteParams( return parsedParams as T extends BoardRouteParametersWithUuid ? never : ParsedBoardRouteParameters; } -export const searchParamsToUrlParams = ({ - gradeAccuracy = DEFAULT_SEARCH_PARAMS.gradeAccuracy, - maxGrade = DEFAULT_SEARCH_PARAMS.maxGrade, - minGrade = DEFAULT_SEARCH_PARAMS.minGrade, - minAscents = DEFAULT_SEARCH_PARAMS.minAscents, - minRating = DEFAULT_SEARCH_PARAMS.minRating, - sortBy, - sortOrder, - name, - onlyClassics, - settername, - setternameSuggestion, - holds, - mirroredHolds, - page, - pageSize +export const searchParamsToUrlParams = ({ + gradeAccuracy = DEFAULT_SEARCH_PARAMS.gradeAccuracy, + maxGrade = DEFAULT_SEARCH_PARAMS.maxGrade, + minGrade = DEFAULT_SEARCH_PARAMS.minGrade, + minAscents = DEFAULT_SEARCH_PARAMS.minAscents, + minRating = DEFAULT_SEARCH_PARAMS.minRating, + sortBy, + sortOrder, + name, + onlyClassics, + settername, + setternameSuggestion, + holdsFilter, + page, + pageSize, }: SearchRequestPagination): URLSearchParams => { - return new URLSearchParams({ - gradeAccuracy: gradeAccuracy.toString(), - maxGrade: maxGrade.toString(), - minAscents: minAscents.toString(), - minGrade: minGrade.toString(), - minRating: minRating.toString(), - sortBy, - sortOrder, - name, - onlyClassics: onlyClassics.toString(), - settername, - setternameSuggestion, - holds, - mirroredHolds, - page: page.toString(), - pageSize: pageSize.toString(), - }); + return new URLSearchParams({ + gradeAccuracy: gradeAccuracy.toString(), + maxGrade: maxGrade.toString(), + minAscents: minAscents.toString(), + minGrade: minGrade.toString(), + minRating: minRating.toString(), + sortBy, + sortOrder, + name, + onlyClassics: onlyClassics.toString(), + settername, + setternameSuggestion, + page: page.toString(), + pageSize: pageSize.toString(), + ...Object.fromEntries( + Object.entries(holdsFilter).map(([key, value]) => { + return [`hold_${key}`, value.state]; + }), + ), + }); }; export const DEFAULT_SEARCH_PARAMS: SearchRequestPagination = { gradeAccuracy: 0, @@ -84,13 +86,18 @@ export const DEFAULT_SEARCH_PARAMS: SearchRequestPagination = { onlyClassics: false, settername: '', setternameSuggestion: '', - holds: '', - mirroredHolds: '', + holdsFilter: {}, page: 0, pageSize: PAGE_LIMIT, }; export const urlParamsToSearchParams = (urlParams: URLSearchParams): SearchRequestPagination => { + const holdsFilter = Object.fromEntries( + Array.from(urlParams.entries()) + .filter(([key]) => key.startsWith('hold_')) + .map(([key, value]) => [key.replace('hold_', ''), value]), + ); + return { ...DEFAULT_SEARCH_PARAMS, gradeAccuracy: Number(urlParams.get('gradeAccuracy') ?? DEFAULT_SEARCH_PARAMS.gradeAccuracy), @@ -104,8 +111,7 @@ export const urlParamsToSearchParams = (urlParams: URLSearchParams): SearchReque onlyClassics: urlParams.get('onlyClassics') === 'true', settername: urlParams.get('settername') ?? DEFAULT_SEARCH_PARAMS.settername, setternameSuggestion: urlParams.get('setternameSuggestion') ?? DEFAULT_SEARCH_PARAMS.setternameSuggestion, - holds: urlParams.get('holds') ?? DEFAULT_SEARCH_PARAMS.holds, - mirroredHolds: urlParams.get('mirroredHolds') ?? DEFAULT_SEARCH_PARAMS.mirroredHolds, + holdsFilter: holdsFilter ?? DEFAULT_SEARCH_PARAMS.holdsFilter, page: Number(urlParams.get('page') ?? DEFAULT_SEARCH_PARAMS.page), pageSize: Number(urlParams.get('pageSize') ?? DEFAULT_SEARCH_PARAMS.pageSize), }; diff --git a/app/sesh/page.tsx b/app/sesh/page.tsx new file mode 100644 index 0000000..3a2b62a --- /dev/null +++ b/app/sesh/page.tsx @@ -0,0 +1,211 @@ +'use client'; +import React, { useState, useEffect } from 'react'; +import { Form, Select, Input, Button, Typography, Divider, Steps } from 'antd'; +import { useRouter } from 'next/navigation'; +import { fetchLayouts, fetchSizes, fetchSets } from '../components/rest-api/api'; +import { ANGLES } from '@/app/lib/board-data'; +import { useBoardProvider } from '../components/board-provider/board-provider-context'; +import { LayoutRow, SetRow, SizeRow } from '../lib/data/queries'; +import { BoardName } from '../lib/types'; + +const { Option } = Select; +const { Text } = Typography; + +const CombinedWizard = () => { + const router = useRouter(); + const [form] = Form.useForm(); + const { login, isAuthenticated } = useBoardProvider(); + const [currentStep, setCurrentStep] = useState(0); + const [isLoggingIn, setIsLoggingIn] = useState(false); + + // Data states + const [layouts, setLayouts] = useState([]); + const [sizes, setSizes] = useState([]); + const [sets, setSets] = useState([]); + const [angles, setAngles] = useState([]); + + // Loading states + const [isLoadingLayouts, setIsLoadingLayouts] = useState(false); + const [isLoadingSizes, setIsLoadingSizes] = useState(false); + const [isLoadingSets, setIsLoadingSets] = useState(false); + + // Fetch layouts when board is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName'); + if (boardName) { + setIsLoadingLayouts(true); + fetchLayouts(boardName) + .then(setLayouts) + .finally(() => setIsLoadingLayouts(false)); + } + }, [form.getFieldValue('boardName')]); + + // Fetch sizes when layout is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName'); + const layoutId = form.getFieldValue('layoutId'); + if (boardName && layoutId) { + setIsLoadingSizes(true); + fetchSizes(boardName, layoutId) + .then(setSizes) + .finally(() => setIsLoadingSizes(false)); + } + }, [form.getFieldValue('layoutId')]); + + // Fetch sets when size is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName'); + const layoutId = form.getFieldValue('layoutId'); + const sizeId = form.getFieldValue('sizeId'); + if (boardName && layoutId && sizeId) { + setIsLoadingSets(true); + fetchSets(boardName, layoutId, sizeId) + .then(setSets) + .finally(() => setIsLoadingSets(false)); + } + }, [form.getFieldValue('sizeId')]); + + // Update angles when board is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName') as BoardName; + if (boardName && ANGLES[boardName]) { + setAngles(ANGLES[boardName]); + } + }, [form.getFieldValue('boardName')]); + + const handleLogin = async () => { + const values = form.getFieldsValue(['username', 'password', 'boardName']); + if (!values.username || !values.password) return; + + setIsLoggingIn(true); + try { + await login(values.boardName, values.username, values.password); + } catch (error) { + console.error('Login failed:', error); + } finally { + setIsLoggingIn(false); + } + }; + + const handleFinish = async (values) => { + const { boardName, layoutId, sizeId, setIds, angle } = values; + const setIdsString = Array.isArray(setIds) ? setIds.join(',') : setIds; + router.push(`/${boardName}/${layoutId}/${sizeId}/${setIdsString}/${angle}/list`); + }; + + const steps = [ + { title: 'Board Selection', content: 'boardName' }, + { title: 'Layout', content: 'layoutId' }, + { title: 'Size', content: 'sizeId' }, + { title: 'Sets', content: 'setIds' }, + { title: 'Angle', content: 'angle' }, + ]; + + return ( +
+ + +
+
+ + + + + {form.getFieldValue('boardName') && ( + <> + + Optional Login + + + {isAuthenticated ? ( +
+ Logged in to {form.getFieldValue('boardName')} board +
+ ) : ( + <> + + + + + + + + + )} + + )} +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + {currentStep < steps.length - 1 ? ( + + ) : ( + + )} +
+
+
+ ); +}; + +export default CombinedWizard; diff --git a/drizzle.config.ts b/drizzle.config.ts index 1c3b878..4faf59e 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ database: process.env.POSTGRES_DATABASE!, port: Number(process.env.POSTGRES_PORT || 5432), user: process.env.POSTGRES_USER, - password: process.env.POSTGRES_PASSWORD, - ssl: process.env.VERCEL_ENV !== 'development', + password: process.env.POSTGRES_PASSWORD, + ssl: process.env.VERCEL_ENV !== 'development', }, }); diff --git a/drizzle/0012_drop_climb_holds_fk.sql b/drizzle/0012_drop_climb_holds_fk.sql new file mode 100644 index 0000000..337a8fa --- /dev/null +++ b/drizzle/0012_drop_climb_holds_fk.sql @@ -0,0 +1,4 @@ +ALTER TABLE "kilter_climb_holds" DROP CONSTRAINT "kilter_climb_holds_climb_uuid_fkey"; +--> statement-breakpoint +ALTER TABLE "tension_climb_holds" DROP CONSTRAINT "tension_climb_holds_climb_uuid_fkey"; +--> statement-breakpoint diff --git a/drizzle/README.md b/drizzle/README.md index e1e9129..1a1dcab 100644 --- a/drizzle/README.md +++ b/drizzle/README.md @@ -1,13 +1,14 @@ # Drizzle in Boardsesh + Writing this down because I will otherwise forget myself. I had issues adopting Prisma, so I decided to try some other random ORM. For no particular reason I ended up with Drizzle, which seems mostly okay. - I made the mistake of deleting some of the snapshots, so dont do that again. To generate a new database migration follow these steps: + 1. Modify the lib/db/schema.ts file with the changes you want 2. Run `npx drizzle-kit generate --name=$MigrationName$` 3. Edit the generated SQL file, and make sure you're happy with it -4. Run `npx drizzle-kit migrate` to exucute the migration \ No newline at end of file +4. Run `npx drizzle-kit migrate` to exucute the migration diff --git a/drizzle/meta/0003_snapshot.json b/drizzle/meta/0003_snapshot.json index ea5ebea..19f7253 100644 --- a/drizzle/meta/0003_snapshot.json +++ b/drizzle/meta/0003_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -610,10 +578,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -891,12 +856,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -998,12 +959,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1122,12 +1079,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1173,12 +1126,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1186,12 +1135,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1255,12 +1200,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1312,12 +1253,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1325,12 +1262,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1338,12 +1271,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1351,12 +1280,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1444,12 +1369,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1507,12 +1428,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1520,12 +1437,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1533,12 +1446,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1621,12 +1530,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1784,12 +1689,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1908,12 +1809,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1921,12 +1818,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1934,12 +1827,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1947,12 +1836,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1986,12 +1871,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1999,12 +1880,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2126,12 +2003,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2139,12 +2012,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2152,12 +2021,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2165,12 +2030,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2265,12 +2126,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2348,12 +2205,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2361,12 +2214,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2510,12 +2359,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2621,10 +2466,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2902,12 +2744,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3009,12 +2847,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3022,12 +2856,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3146,12 +2976,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3197,12 +3023,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3210,12 +3032,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3279,12 +3097,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3336,12 +3150,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3349,12 +3159,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3362,12 +3168,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3375,12 +3177,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3468,12 +3266,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3531,12 +3325,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3544,12 +3334,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3557,12 +3343,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3645,12 +3427,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3808,12 +3586,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3932,12 +3706,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3945,12 +3715,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3958,12 +3724,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3971,12 +3733,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4010,12 +3768,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4023,12 +3777,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4051,4 +3801,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0004_snapshot.json b/drizzle/meta/0004_snapshot.json index 5271850..279fee6 100644 --- a/drizzle/meta/0004_snapshot.json +++ b/drizzle/meta/0004_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -426,9 +398,7 @@ "kilter_circuits_uuid_unique": { "name": "kilter_circuits_uuid_unique", "nullsNotDistinct": false, - "columns": [ - "uuid" - ] + "columns": ["uuid"] } }, "policies": {}, @@ -507,12 +477,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -618,10 +584,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -899,12 +862,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1006,12 +965,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1130,12 +1085,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1181,12 +1132,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1194,12 +1141,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1263,12 +1206,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1320,12 +1259,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1333,12 +1268,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1346,12 +1277,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1359,12 +1286,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1452,12 +1375,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1515,12 +1434,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1528,12 +1443,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1541,12 +1452,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1629,12 +1536,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1792,12 +1695,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1916,12 +1815,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1929,12 +1824,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1942,12 +1833,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1955,12 +1842,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1994,12 +1877,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2007,12 +1886,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2134,12 +2009,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2147,12 +2018,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2160,12 +2027,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2173,12 +2036,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2273,12 +2132,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2356,12 +2211,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2369,12 +2220,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2445,9 +2292,7 @@ "tension_circuits_uuid_unique": { "name": "tension_circuits_uuid_unique", "nullsNotDistinct": false, - "columns": [ - "uuid" - ] + "columns": ["uuid"] } }, "policies": {}, @@ -2526,12 +2371,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2637,10 +2478,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2918,12 +2756,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3025,12 +2859,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3038,12 +2868,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3162,12 +2988,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3213,12 +3035,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3226,12 +3044,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3295,12 +3109,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3352,12 +3162,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3365,12 +3171,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3378,12 +3180,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3391,12 +3189,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3484,12 +3278,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3547,12 +3337,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3560,12 +3346,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3573,12 +3355,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3661,12 +3439,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3824,12 +3598,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3948,12 +3718,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3961,12 +3727,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3974,12 +3736,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3987,12 +3745,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4026,12 +3780,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4039,12 +3789,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4067,4 +3813,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0005_snapshot.json b/drizzle/meta/0005_snapshot.json index 022ef4c..a1408da 100644 --- a/drizzle/meta/0005_snapshot.json +++ b/drizzle/meta/0005_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -426,9 +398,7 @@ "kilter_circuits_uuid_unique": { "name": "kilter_circuits_uuid_unique", "nullsNotDistinct": false, - "columns": [ - "uuid" - ] + "columns": ["uuid"] } }, "policies": {}, @@ -507,12 +477,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -618,10 +584,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -899,12 +862,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1006,12 +965,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1130,12 +1085,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1181,12 +1132,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1194,12 +1141,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1263,12 +1206,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1320,12 +1259,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1333,12 +1268,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1346,12 +1277,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1359,12 +1286,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1452,12 +1375,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1515,12 +1434,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1528,12 +1443,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1541,12 +1452,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1629,12 +1536,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1792,12 +1695,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1805,10 +1704,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1924,12 +1820,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1937,12 +1829,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1950,12 +1838,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1963,12 +1847,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2002,12 +1882,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2015,12 +1891,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2142,12 +2014,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2155,12 +2023,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2168,12 +2032,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2181,12 +2041,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2281,12 +2137,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2364,12 +2216,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2377,12 +2225,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2453,9 +2297,7 @@ "tension_circuits_uuid_unique": { "name": "tension_circuits_uuid_unique", "nullsNotDistinct": false, - "columns": [ - "uuid" - ] + "columns": ["uuid"] } }, "policies": {}, @@ -2534,12 +2376,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2645,10 +2483,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2926,12 +2761,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3033,12 +2864,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3046,12 +2873,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3170,12 +2993,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3221,12 +3040,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3234,12 +3049,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3303,12 +3114,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3360,12 +3167,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3373,12 +3176,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3386,12 +3185,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3399,12 +3194,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3492,12 +3283,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3555,12 +3342,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3568,12 +3351,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3581,12 +3360,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3669,12 +3444,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3832,12 +3603,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3845,10 +3612,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -3964,12 +3728,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3977,12 +3737,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3990,12 +3746,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4003,12 +3755,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4042,12 +3790,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4055,12 +3799,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4083,4 +3823,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0006_snapshot.json b/drizzle/meta/0006_snapshot.json index c55fa46..d25df6e 100644 --- a/drizzle/meta/0006_snapshot.json +++ b/drizzle/meta/0006_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -610,10 +578,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -891,12 +856,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -998,12 +959,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1122,12 +1079,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1173,12 +1126,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1186,12 +1135,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1255,12 +1200,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1312,12 +1253,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1325,12 +1262,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1338,12 +1271,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1351,12 +1280,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1444,12 +1369,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1507,12 +1428,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1520,12 +1437,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1533,12 +1446,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1621,12 +1530,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1784,12 +1689,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1797,10 +1698,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1916,12 +1814,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1929,12 +1823,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1942,12 +1832,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1955,12 +1841,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1994,12 +1876,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2007,12 +1885,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2134,12 +2008,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2147,12 +2017,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2160,12 +2026,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2173,12 +2035,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2273,12 +2131,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2356,12 +2210,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2369,12 +2219,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2518,12 +2364,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2629,10 +2471,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2910,12 +2749,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3017,12 +2852,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3030,12 +2861,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3154,12 +2981,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3205,12 +3028,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3218,12 +3037,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3287,12 +3102,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3344,12 +3155,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3357,12 +3164,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3370,12 +3173,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3383,12 +3182,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3476,12 +3271,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3539,12 +3330,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3552,12 +3339,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3565,12 +3348,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3653,12 +3432,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3816,12 +3591,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3829,10 +3600,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -3948,12 +3716,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3961,12 +3725,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3974,12 +3734,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3987,12 +3743,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4026,12 +3778,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4039,12 +3787,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4067,4 +3811,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0007_snapshot.json b/drizzle/meta/0007_snapshot.json index af1dfea..a56d815 100644 --- a/drizzle/meta/0007_snapshot.json +++ b/drizzle/meta/0007_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -604,10 +572,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -885,12 +850,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -992,12 +953,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1116,12 +1073,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1167,12 +1120,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1180,12 +1129,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1249,12 +1194,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1306,12 +1247,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1319,12 +1256,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1332,12 +1265,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1345,12 +1274,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1438,12 +1363,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1501,12 +1422,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1514,12 +1431,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1527,12 +1440,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1615,12 +1524,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1778,12 +1683,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1791,10 +1692,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1910,12 +1808,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1923,12 +1817,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1936,12 +1826,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1949,12 +1835,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1988,12 +1870,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2001,12 +1879,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2128,12 +2002,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2141,12 +2011,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2154,12 +2020,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2167,12 +2029,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2267,12 +2125,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2350,12 +2204,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2363,12 +2213,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2512,12 +2358,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2617,10 +2459,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2898,12 +2737,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3005,12 +2840,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3018,12 +2849,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3142,12 +2969,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3193,12 +3016,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3206,12 +3025,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3275,12 +3090,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3332,12 +3143,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3345,12 +3152,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3358,12 +3161,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3371,12 +3170,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3464,12 +3259,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3527,12 +3318,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3540,12 +3327,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3553,12 +3336,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3641,12 +3420,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3804,12 +3579,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3817,10 +3588,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -3936,12 +3704,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3949,12 +3713,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3962,12 +3722,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3975,12 +3731,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4014,12 +3766,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4027,12 +3775,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4055,4 +3799,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0008_snapshot.json b/drizzle/meta/0008_snapshot.json index 9335f38..4333650 100644 --- a/drizzle/meta/0008_snapshot.json +++ b/drizzle/meta/0008_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -605,12 +573,8 @@ "name": "kilter_climb_stats_climb_uuid_kilter_climbs_uuid_fk", "tableFrom": "kilter_climb_stats", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -618,10 +582,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -899,12 +860,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1006,12 +963,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1130,12 +1083,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1181,12 +1130,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1194,12 +1139,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1263,12 +1204,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1320,12 +1257,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1333,12 +1266,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1346,12 +1275,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1359,12 +1284,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1452,12 +1373,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1515,12 +1432,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1528,12 +1441,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1541,12 +1450,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1629,12 +1534,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1792,12 +1693,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1805,10 +1702,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1924,12 +1818,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1937,12 +1827,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1950,12 +1836,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1963,12 +1845,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2002,12 +1880,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2015,12 +1889,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2142,12 +2012,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2155,12 +2021,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2168,12 +2030,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2181,12 +2039,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2281,12 +2135,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2364,12 +2214,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2377,12 +2223,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2526,12 +2368,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2632,12 +2470,8 @@ "name": "tension_climb_stats_climb_uuid_tension_climbs_uuid_fk", "tableFrom": "tension_climb_stats", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2645,10 +2479,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2926,12 +2757,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3033,12 +2860,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3046,12 +2869,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3170,12 +2989,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3221,12 +3036,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3234,12 +3045,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3303,12 +3110,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3360,12 +3163,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3373,12 +3172,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3386,12 +3181,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3399,12 +3190,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3492,12 +3279,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3555,12 +3338,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3568,12 +3347,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3581,12 +3356,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3669,12 +3440,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3832,12 +3599,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3845,10 +3608,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -3964,12 +3724,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3977,12 +3733,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3990,12 +3742,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4003,12 +3751,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4042,12 +3786,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4055,12 +3795,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4083,4 +3819,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0009_snapshot.json b/drizzle/meta/0009_snapshot.json index 69bf983..1432c30 100644 --- a/drizzle/meta/0009_snapshot.json +++ b/drizzle/meta/0009_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -605,12 +573,8 @@ "name": "kilter_climb_stats_climb_uuid_kilter_climbs_uuid_fk", "tableFrom": "kilter_climb_stats", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -618,10 +582,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -899,12 +860,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1006,12 +963,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1130,12 +1083,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1181,12 +1130,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1194,12 +1139,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1263,12 +1204,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1320,12 +1257,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1333,12 +1266,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1346,12 +1275,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1359,12 +1284,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1452,12 +1373,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1515,12 +1432,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1528,12 +1441,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1541,12 +1450,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1629,12 +1534,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1792,12 +1693,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1805,10 +1702,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1924,12 +1818,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1937,12 +1827,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1950,12 +1836,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1963,12 +1845,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2002,12 +1880,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2015,12 +1889,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2142,12 +2012,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2155,12 +2021,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2168,12 +2030,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2181,12 +2039,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2281,12 +2135,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2364,12 +2214,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2377,12 +2223,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2526,12 +2368,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2632,12 +2470,8 @@ "name": "tension_climb_stats_climb_uuid_tension_climbs_uuid_fk", "tableFrom": "tension_climb_stats", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2645,10 +2479,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2926,12 +2757,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3033,12 +2860,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3046,12 +2869,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3170,12 +2989,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3221,12 +3036,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3234,12 +3045,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3303,12 +3110,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3360,12 +3163,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3373,12 +3172,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3386,12 +3181,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3399,12 +3190,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3492,12 +3279,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3555,12 +3338,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3568,12 +3347,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3581,12 +3356,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3669,12 +3440,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3832,12 +3599,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3845,10 +3608,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -3964,12 +3724,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3977,12 +3733,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3990,12 +3742,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4003,12 +3751,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4042,12 +3786,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4055,12 +3795,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4083,4 +3819,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0010_snapshot.json b/drizzle/meta/0010_snapshot.json index 039583b..2170086 100644 --- a/drizzle/meta/0010_snapshot.json +++ b/drizzle/meta/0010_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -604,10 +572,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -885,12 +850,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -992,12 +953,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1116,12 +1073,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1167,12 +1120,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1180,12 +1129,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1249,12 +1194,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1306,12 +1247,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1319,12 +1256,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1332,12 +1265,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1345,12 +1274,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1438,12 +1363,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1501,12 +1422,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1514,12 +1431,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1527,12 +1440,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1615,12 +1524,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1778,12 +1683,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1791,10 +1692,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1910,12 +1808,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1923,12 +1817,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1936,12 +1826,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1949,12 +1835,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1988,12 +1870,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2001,12 +1879,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2128,12 +2002,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2141,12 +2011,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2154,12 +2020,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2167,12 +2029,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2267,12 +2125,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2350,12 +2204,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2363,12 +2213,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2512,12 +2358,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2617,10 +2459,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -2898,12 +2737,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3005,12 +2840,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3018,12 +2849,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3142,12 +2969,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3193,12 +3016,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3206,12 +3025,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3275,12 +3090,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3332,12 +3143,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3345,12 +3152,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3358,12 +3161,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3371,12 +3170,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3464,12 +3259,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3527,12 +3318,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3540,12 +3327,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3553,12 +3336,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3641,12 +3420,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3804,12 +3579,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3817,10 +3588,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -3936,12 +3704,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3949,12 +3713,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3962,12 +3722,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3975,12 +3731,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4014,12 +3766,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4027,12 +3775,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4055,4 +3799,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0011_snapshot.json b/drizzle/meta/0011_snapshot.json index 8b31b69..192be52 100644 --- a/drizzle/meta/0011_snapshot.json +++ b/drizzle/meta/0011_snapshot.json @@ -115,12 +115,8 @@ "name": "ascents_attempt_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -128,12 +124,8 @@ "name": "ascents_climb_uuid_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -141,12 +133,8 @@ "name": "ascents_difficulty_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -154,12 +142,8 @@ "name": "ascents_user_id_fkey1", "tableFrom": "kilter_ascents", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -254,12 +238,8 @@ "name": "beta_links_climb_uuid_fkey1", "tableFrom": "kilter_beta_links", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -337,12 +317,8 @@ "name": "bids_climb_uuid_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -350,12 +326,8 @@ "name": "bids_user_id_fkey1", "tableFrom": "kilter_bids", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -499,12 +471,8 @@ "name": "climb_cache_fields_climb_uuid_fkey1", "tableFrom": "kilter_climb_cache_fields", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -573,12 +541,8 @@ "name": "kilter_climb_holds_climb_uuid_fkey", "tableFrom": "kilter_climb_holds", "tableTo": "kilter_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -586,10 +550,7 @@ "compositePrimaryKeys": { "kilter_climb_holds_climb_uuid_hold_id_pk": { "name": "kilter_climb_holds_climb_uuid_hold_id_pk", - "columns": [ - "climb_uuid", - "hold_id" - ] + "columns": ["climb_uuid", "hold_id"] } }, "uniqueConstraints": {}, @@ -686,10 +647,7 @@ "compositePrimaryKeys": { "kilter_climb_stats_pk": { "name": "kilter_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -967,12 +925,8 @@ "name": "climbs_layout_id_fkey1", "tableFrom": "kilter_climbs", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1074,12 +1028,8 @@ "name": "holes_product_id_fkey1", "tableFrom": "kilter_holes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1198,12 +1148,8 @@ "name": "layouts_product_id_fkey1", "tableFrom": "kilter_layouts", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1249,12 +1195,8 @@ "name": "leds_hole_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1262,12 +1204,8 @@ "name": "leds_product_size_id_fkey1", "tableFrom": "kilter_leds", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1331,12 +1269,8 @@ "name": "placement_roles_product_id_fkey1", "tableFrom": "kilter_placement_roles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1388,12 +1322,8 @@ "name": "placements_default_placement_role_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -1401,12 +1331,8 @@ "name": "placements_hole_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1414,12 +1340,8 @@ "name": "placements_layout_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1427,12 +1349,8 @@ "name": "placements_set_id_fkey1", "tableFrom": "kilter_placements", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1520,12 +1438,8 @@ "name": "product_sizes_product_id_fkey1", "tableFrom": "kilter_product_sizes", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1583,12 +1497,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1596,12 +1506,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -1609,12 +1515,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey1", "tableFrom": "kilter_product_sizes_layouts_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1697,12 +1599,8 @@ "name": "products_angles_product_id_fkey1", "tableFrom": "kilter_products_angles", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1860,12 +1758,8 @@ "name": "user_syncs_user_id_fkey1", "tableFrom": "kilter_user_syncs", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -1873,10 +1767,7 @@ "compositePrimaryKeys": { "kilter_user_sync_pk": { "name": "kilter_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -1992,12 +1883,8 @@ "name": "walls_layout_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2005,12 +1892,8 @@ "name": "walls_product_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2018,12 +1901,8 @@ "name": "walls_product_size_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2031,12 +1910,8 @@ "name": "walls_user_id_fkey1", "tableFrom": "kilter_walls", "tableTo": "kilter_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2070,12 +1945,8 @@ "name": "walls_sets_set_id_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2083,12 +1954,8 @@ "name": "walls_sets_wall_uuid_fkey1", "tableFrom": "kilter_walls_sets", "tableTo": "kilter_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2210,12 +2077,8 @@ "name": "ascents_attempt_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_attempts", - "columnsFrom": [ - "attempt_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attempt_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2223,12 +2086,8 @@ "name": "ascents_climb_uuid_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2236,12 +2095,8 @@ "name": "ascents_difficulty_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_difficulty_grades", - "columnsFrom": [ - "difficulty" - ], - "columnsTo": [ - "difficulty" - ], + "columnsFrom": ["difficulty"], + "columnsTo": ["difficulty"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2249,12 +2104,8 @@ "name": "ascents_user_id_fkey", "tableFrom": "tension_ascents", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2349,12 +2200,8 @@ "name": "beta_links_climb_uuid_fkey", "tableFrom": "tension_beta_links", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" } @@ -2432,12 +2279,8 @@ "name": "bids_climb_uuid_fkey", "tableFrom": "tension_bids", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -2445,12 +2288,8 @@ "name": "bids_user_id_fkey", "tableFrom": "tension_bids", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2594,12 +2433,8 @@ "name": "climb_cache_fields_climb_uuid_fkey", "tableFrom": "tension_climb_cache_fields", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2668,12 +2503,8 @@ "name": "tension_climb_holds_climb_uuid_fkey", "tableFrom": "tension_climb_holds", "tableTo": "tension_climbs", - "columnsFrom": [ - "climb_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["climb_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -2681,10 +2512,7 @@ "compositePrimaryKeys": { "tension_climb_holds_climb_uuid_hold_id_pk": { "name": "tension_climb_holds_climb_uuid_hold_id_pk", - "columns": [ - "climb_uuid", - "hold_id" - ] + "columns": ["climb_uuid", "hold_id"] } }, "uniqueConstraints": {}, @@ -2781,10 +2609,7 @@ "compositePrimaryKeys": { "tension_climb_stats_pk": { "name": "tension_climb_stats_pk", - "columns": [ - "climb_uuid", - "angle" - ] + "columns": ["climb_uuid", "angle"] } }, "uniqueConstraints": {}, @@ -3062,12 +2887,8 @@ "name": "climbs_layout_id_fkey", "tableFrom": "tension_climbs", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3169,12 +2990,8 @@ "name": "holes_mirrored_hole_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_holes", - "columnsFrom": [ - "mirrored_hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["mirrored_hole_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3182,12 +2999,8 @@ "name": "holes_product_id_fkey", "tableFrom": "tension_holes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3306,12 +3119,8 @@ "name": "layouts_product_id_fkey", "tableFrom": "tension_layouts", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3357,12 +3166,8 @@ "name": "leds_hole_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3370,12 +3175,8 @@ "name": "leds_product_size_id_fkey", "tableFrom": "tension_leds", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3439,12 +3240,8 @@ "name": "placement_roles_product_id_fkey", "tableFrom": "tension_placement_roles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3496,12 +3293,8 @@ "name": "placements_default_placement_role_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_placement_roles", - "columnsFrom": [ - "default_placement_role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_placement_role_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -3509,12 +3302,8 @@ "name": "placements_hole_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_holes", - "columnsFrom": [ - "hole_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hole_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3522,12 +3311,8 @@ "name": "placements_layout_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3535,12 +3320,8 @@ "name": "placements_set_id_fkey", "tableFrom": "tension_placements", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3628,12 +3409,8 @@ "name": "product_sizes_product_id_fkey", "tableFrom": "tension_product_sizes", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3691,12 +3468,8 @@ "name": "product_sizes_layouts_sets_layout_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3704,12 +3477,8 @@ "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" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" }, @@ -3717,12 +3486,8 @@ "name": "product_sizes_layouts_sets_set_id_fkey", "tableFrom": "tension_product_sizes_layouts_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3805,12 +3570,8 @@ "name": "products_angles_product_id_fkey", "tableFrom": "tension_products_angles", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3968,12 +3729,8 @@ "name": "user_syncs_user_id_fkey", "tableFrom": "tension_user_syncs", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -3981,10 +3738,7 @@ "compositePrimaryKeys": { "tension_user_sync_pk": { "name": "tension_user_sync_pk", - "columns": [ - "user_id", - "table_name" - ] + "columns": ["user_id", "table_name"] } }, "uniqueConstraints": {}, @@ -4100,12 +3854,8 @@ "name": "walls_layout_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_layouts", - "columnsFrom": [ - "layout_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["layout_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4113,12 +3863,8 @@ "name": "walls_product_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_products", - "columnsFrom": [ - "product_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4126,12 +3872,8 @@ "name": "walls_product_size_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_product_sizes", - "columnsFrom": [ - "product_size_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["product_size_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4139,12 +3881,8 @@ "name": "walls_user_id_fkey", "tableFrom": "tension_walls", "tableTo": "tension_users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4178,12 +3916,8 @@ "name": "walls_sets_set_id_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_sets", - "columnsFrom": [ - "set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["set_id"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "cascade" }, @@ -4191,12 +3925,8 @@ "name": "walls_sets_wall_uuid_fkey", "tableFrom": "tension_walls_sets", "tableTo": "tension_walls", - "columnsFrom": [ - "wall_uuid" - ], - "columnsTo": [ - "uuid" - ], + "columnsFrom": ["wall_uuid"], + "columnsTo": ["uuid"], "onDelete": "cascade", "onUpdate": "cascade" } @@ -4219,4 +3949,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/drizzle/meta/0012_snapshot.json b/drizzle/meta/0012_snapshot.json new file mode 100644 index 0000000..f18140b --- /dev/null +++ b/drizzle/meta/0012_snapshot.json @@ -0,0 +1,3944 @@ +{ + "id": "7184f721-6b48-4e6c-845a-9804359d0a02", + "prevId": "b372ecf4-d48f-49a7-9dab-77ab69e42854", + "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 + }, + "frame_number": { + "name": "frame_number", + "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": {}, + "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 + }, + "frame_number": { + "name": "frame_number", + "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": {}, + "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": {} + } +} diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 6691754..3b5d824 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -85,6 +85,13 @@ "when": 1735770051923, "tag": "0011_add_holds_map_table", "breakpoints": true + }, + { + "idx": 12, + "version": "7", + "when": 1736553172493, + "tag": "0012_drop_climb_holds_fk", + "breakpoints": true } ] -} \ No newline at end of file +} From 4ac83dd9b59942542788df80d6382c94bc09f952 Mon Sep 17 00:00:00 2001 From: Marco de Jongh <1107647+marcodejongh@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:17:56 +1100 Subject: [PATCH 3/4] Get it to build --- .../climb-card/climb-card-cover.tsx | 2 +- app/components/climb-card/climb-thumbnail.tsx | 2 +- .../search-drawer/climb-hold-search-form.tsx | 8 +- app/components/search-drawer/constants.ts | 3 +- app/lib/url-utils.ts | 3 + app/sesh/page.tsx | 427 +++++++++--------- 6 files changed, 229 insertions(+), 216 deletions(-) diff --git a/app/components/climb-card/climb-card-cover.tsx b/app/components/climb-card/climb-card-cover.tsx index c9e8b9f..99fb28c 100644 --- a/app/components/climb-card/climb-card-cover.tsx +++ b/app/components/climb-card/climb-card-cover.tsx @@ -24,7 +24,7 @@ const ClimbCardCover = ({ climb, boardDetails, onClick }: ClimbCardCoverProps) = cursor: 'pointer', }} > - + setModalOpen(false)} diff --git a/app/components/climb-card/climb-thumbnail.tsx b/app/components/climb-card/climb-thumbnail.tsx index d7b99d0..ffa5db4 100644 --- a/app/components/climb-card/climb-thumbnail.tsx +++ b/app/components/climb-card/climb-thumbnail.tsx @@ -17,7 +17,7 @@ const ClimbThumbnail = ({ boardDetails, currentClimb }: ClimbThumbnailProps) => setModalOpen(true) : undefined}> diff --git a/app/components/search-drawer/climb-hold-search-form.tsx b/app/components/search-drawer/climb-hold-search-form.tsx index 93baf90..925cf14 100644 --- a/app/components/search-drawer/climb-hold-search-form.tsx +++ b/app/components/search-drawer/climb-hold-search-form.tsx @@ -18,7 +18,7 @@ const ClimbHoldSearchForm: React.FC = ({ boardDetails const { uiSearchParams, updateFilters } = useUISearchParams(); const [selectedState, setSelectedState] = React.useState('ANY'); - const getStateCode = (state: HoldState, boardName: BoardName): HoldCode => { + const getStateCode = (state: HoldState, boardName: BoardName): HoldCode | null => { if (state === 'ANY' || state === 'NOT') return null; const stateMap = HOLD_STATE_MAP[boardName]; @@ -44,6 +44,7 @@ const ClimbHoldSearchForm: React.FC = ({ boardDetails } // Handle other states else { + //@ts-expect-error fix later const currentValue = uiSearchParams[holdKey]; if (currentValue === stateCode?.toString()) { updates[holdKey] = undefined; @@ -78,7 +79,7 @@ const ClimbHoldSearchForm: React.FC = ({ boardDetails state: 'ANY', color: '#b76e79', }; - } else { + } else if (stateCode !== null) { const stateInfo = HOLD_STATE_MAP[boardDetails.board_name as BoardName][stateCode]; displayInfo = { state: stateInfo.name, @@ -87,11 +88,13 @@ const ClimbHoldSearchForm: React.FC = ({ boardDetails } if (displayInfo) { + //@ts-expect-error cbf newSelectedHolds[holdId] = displayInfo; } } updateFilters({ + //@ts-expect-error will fix later holdsFilter: newSelectedHolds, }); }; @@ -100,6 +103,7 @@ const ClimbHoldSearchForm: React.FC = ({ boardDetails const updates: Record = {}; updateFilters({ + //@ts-expect-error holdsFilter: {}, }); }; diff --git a/app/components/search-drawer/constants.ts b/app/components/search-drawer/constants.ts index f86b102..1a9088e 100644 --- a/app/components/search-drawer/constants.ts +++ b/app/components/search-drawer/constants.ts @@ -14,7 +14,8 @@ export const defaultClimbSearchParameters: SearchRequestPagination = { gradeAccuracy: 1, settername: '', setternameSuggestion: '', - holds: '', + //@ts-expect-error TODO fix later + holdsFilter: '', mirroredHolds: '', pageSize: PAGE_LIMIT, page: 0, diff --git a/app/lib/url-utils.ts b/app/lib/url-utils.ts index 17d2508..771cec1 100644 --- a/app/lib/url-utils.ts +++ b/app/lib/url-utils.ts @@ -69,6 +69,7 @@ export const searchParamsToUrlParams = ({ pageSize: pageSize.toString(), ...Object.fromEntries( Object.entries(holdsFilter).map(([key, value]) => { + //@ts-expect-error fix later return [`hold_${key}`, value.state]; }), ), @@ -86,6 +87,7 @@ export const DEFAULT_SEARCH_PARAMS: SearchRequestPagination = { onlyClassics: false, settername: '', setternameSuggestion: '', + //@ts-expect-error fix later holdsFilter: {}, page: 0, pageSize: PAGE_LIMIT, @@ -111,6 +113,7 @@ export const urlParamsToSearchParams = (urlParams: URLSearchParams): SearchReque onlyClassics: urlParams.get('onlyClassics') === 'true', settername: urlParams.get('settername') ?? DEFAULT_SEARCH_PARAMS.settername, setternameSuggestion: urlParams.get('setternameSuggestion') ?? DEFAULT_SEARCH_PARAMS.setternameSuggestion, + //@ts-expect-error fix later holdsFilter: holdsFilter ?? DEFAULT_SEARCH_PARAMS.holdsFilter, page: Number(urlParams.get('page') ?? DEFAULT_SEARCH_PARAMS.page), pageSize: Number(urlParams.get('pageSize') ?? DEFAULT_SEARCH_PARAMS.pageSize), diff --git a/app/sesh/page.tsx b/app/sesh/page.tsx index 3a2b62a..65e5d5f 100644 --- a/app/sesh/page.tsx +++ b/app/sesh/page.tsx @@ -1,211 +1,216 @@ -'use client'; -import React, { useState, useEffect } from 'react'; -import { Form, Select, Input, Button, Typography, Divider, Steps } from 'antd'; -import { useRouter } from 'next/navigation'; -import { fetchLayouts, fetchSizes, fetchSets } from '../components/rest-api/api'; -import { ANGLES } from '@/app/lib/board-data'; -import { useBoardProvider } from '../components/board-provider/board-provider-context'; -import { LayoutRow, SetRow, SizeRow } from '../lib/data/queries'; -import { BoardName } from '../lib/types'; - -const { Option } = Select; -const { Text } = Typography; - -const CombinedWizard = () => { - const router = useRouter(); - const [form] = Form.useForm(); - const { login, isAuthenticated } = useBoardProvider(); - const [currentStep, setCurrentStep] = useState(0); - const [isLoggingIn, setIsLoggingIn] = useState(false); - - // Data states - const [layouts, setLayouts] = useState([]); - const [sizes, setSizes] = useState([]); - const [sets, setSets] = useState([]); - const [angles, setAngles] = useState([]); - - // Loading states - const [isLoadingLayouts, setIsLoadingLayouts] = useState(false); - const [isLoadingSizes, setIsLoadingSizes] = useState(false); - const [isLoadingSets, setIsLoadingSets] = useState(false); - - // Fetch layouts when board is selected - useEffect(() => { - const boardName = form.getFieldValue('boardName'); - if (boardName) { - setIsLoadingLayouts(true); - fetchLayouts(boardName) - .then(setLayouts) - .finally(() => setIsLoadingLayouts(false)); - } - }, [form.getFieldValue('boardName')]); - - // Fetch sizes when layout is selected - useEffect(() => { - const boardName = form.getFieldValue('boardName'); - const layoutId = form.getFieldValue('layoutId'); - if (boardName && layoutId) { - setIsLoadingSizes(true); - fetchSizes(boardName, layoutId) - .then(setSizes) - .finally(() => setIsLoadingSizes(false)); - } - }, [form.getFieldValue('layoutId')]); - - // Fetch sets when size is selected - useEffect(() => { - const boardName = form.getFieldValue('boardName'); - const layoutId = form.getFieldValue('layoutId'); - const sizeId = form.getFieldValue('sizeId'); - if (boardName && layoutId && sizeId) { - setIsLoadingSets(true); - fetchSets(boardName, layoutId, sizeId) - .then(setSets) - .finally(() => setIsLoadingSets(false)); - } - }, [form.getFieldValue('sizeId')]); - - // Update angles when board is selected - useEffect(() => { - const boardName = form.getFieldValue('boardName') as BoardName; - if (boardName && ANGLES[boardName]) { - setAngles(ANGLES[boardName]); - } - }, [form.getFieldValue('boardName')]); - - const handleLogin = async () => { - const values = form.getFieldsValue(['username', 'password', 'boardName']); - if (!values.username || !values.password) return; - - setIsLoggingIn(true); - try { - await login(values.boardName, values.username, values.password); - } catch (error) { - console.error('Login failed:', error); - } finally { - setIsLoggingIn(false); - } - }; - - const handleFinish = async (values) => { - const { boardName, layoutId, sizeId, setIds, angle } = values; - const setIdsString = Array.isArray(setIds) ? setIds.join(',') : setIds; - router.push(`/${boardName}/${layoutId}/${sizeId}/${setIdsString}/${angle}/list`); - }; - - const steps = [ - { title: 'Board Selection', content: 'boardName' }, - { title: 'Layout', content: 'layoutId' }, - { title: 'Size', content: 'sizeId' }, - { title: 'Sets', content: 'setIds' }, - { title: 'Angle', content: 'angle' }, - ]; - - return ( -
- - -
-
- - - - - {form.getFieldValue('boardName') && ( - <> - - Optional Login - - - {isAuthenticated ? ( -
- Logged in to {form.getFieldValue('boardName')} board -
- ) : ( - <> - - - - - - - - - )} - - )} -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - {currentStep < steps.length - 1 ? ( - - ) : ( - - )} -
-
-
- ); -}; - -export default CombinedWizard; +// /** +// * +// */ + +// //@ts-ignore +// 'use client'; +// import React, { useState, useEffect } from 'react'; +// import { Form, Select, Input, Button, Typography, Divider, Steps } from 'antd'; +// import { useRouter } from 'next/navigation'; +// import { fetchLayouts, fetchSizes, fetchSets } from '../components/rest-api/api'; +// import { ANGLES } from '@/app/lib/board-data'; +// import { useBoardProvider } from '../components/board-provider/board-provider-context'; +// import { LayoutRow, SetRow, SizeRow } from '../lib/data/queries'; +// import { BoardName } from '../lib/types'; + +// const { Option } = Select; +// const { Text } = Typography; + +// const CombinedWizard = () => { +// const router = useRouter(); +// const [form] = Form.useForm(); +// const { login, isAuthenticated } = useBoardProvider(); +// const [currentStep, setCurrentStep] = useState(0); +// const [isLoggingIn, setIsLoggingIn] = useState(false); + +// // Data states +// const [layouts, setLayouts] = useState([]); +// const [sizes, setSizes] = useState([]); +// const [sets, setSets] = useState([]); +// const [angles, setAngles] = useState([]); + +// // Loading states +// const [isLoadingLayouts, setIsLoadingLayouts] = useState(false); +// const [isLoadingSizes, setIsLoadingSizes] = useState(false); +// const [isLoadingSets, setIsLoadingSets] = useState(false); + +// // Fetch layouts when board is selected +// useEffect(() => { +// const boardName = form.getFieldValue('boardName'); +// if (boardName) { +// setIsLoadingLayouts(true); +// fetchLayouts(boardName) +// .then(setLayouts) +// .finally(() => setIsLoadingLayouts(false)); +// } +// }, [form.getFieldValue('boardName')]); + +// // Fetch sizes when layout is selected +// useEffect(() => { +// const boardName = form.getFieldValue('boardName'); +// const layoutId = form.getFieldValue('layoutId'); +// if (boardName && layoutId) { +// setIsLoadingSizes(true); +// fetchSizes(boardName, layoutId) +// .then(setSizes) +// .finally(() => setIsLoadingSizes(false)); +// } +// }, [form.getFieldValue('layoutId')]); + +// // Fetch sets when size is selected +// useEffect(() => { +// const boardName = form.getFieldValue('boardName'); +// const layoutId = form.getFieldValue('layoutId'); +// const sizeId = form.getFieldValue('sizeId'); +// if (boardName && layoutId && sizeId) { +// setIsLoadingSets(true); +// fetchSets(boardName, layoutId, sizeId) +// .then(setSets) +// .finally(() => setIsLoadingSets(false)); +// } +// }, [form.getFieldValue('sizeId')]); + +// // Update angles when board is selected +// useEffect(() => { +// const boardName = form.getFieldValue('boardName') as BoardName; +// if (boardName && ANGLES[boardName]) { +// setAngles(ANGLES[boardName]); +// } +// }, [form.getFieldValue('boardName')]); + +// const handleLogin = async () => { +// const values = form.getFieldsValue(['username', 'password', 'boardName']); +// if (!values.username || !values.password) return; + +// setIsLoggingIn(true); +// try { +// await login(values.boardName, values.username, values.password); +// } catch (error) { +// console.error('Login failed:', error); +// } finally { +// setIsLoggingIn(false); +// } +// }; +// //@ts-expect-error +// const handleFinish = async (values) => { +// const { boardName, layoutId, sizeId, setIds, angle } = values; +// const setIdsString = Array.isArray(setIds) ? setIds.join(',') : setIds; +// router.push(`/${boardName}/${layoutId}/${sizeId}/${setIdsString}/${angle}/list`); +// }; + +// const steps = [ +// { title: 'Board Selection', content: 'boardName' }, +// { title: 'Layout', content: 'layoutId' }, +// { title: 'Size', content: 'sizeId' }, +// { title: 'Sets', content: 'setIds' }, +// { title: 'Angle', content: 'angle' }, +// ]; + +// return ( +//
+// + +//
+//
+// +// +// + +// {form.getFieldValue('boardName') && ( +// <> +// +// Optional Login +// + +// {isAuthenticated ? ( +//
+// Logged in to {form.getFieldValue('boardName')} board +//
+// ) : ( +// <> +// +// +// +// +// +// +// +// +// )} +// +// )} +//
+ +//
+// +// +// +//
+ +//
+// +// +// +//
+ +//
+// +// +// +//
+ +//
+// +// +// +//
+ +//
+// +// {currentStep < steps.length - 1 ? ( +// +// ) : ( +// +// )} +//
+//
+//
+// ); +// }; + +// export default CombinedWizard; From 3e30db5de69333dbdb4c2db72212557ae7947415 Mon Sep 17 00:00:00 2001 From: Marco de Jongh <1107647+marcodejongh@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:20:53 +1100 Subject: [PATCH 4/4] Get it to build --- app/sesh/newstartpage.tsx | 216 ++++++++++++++++++++++++++++++++++++++ app/sesh/page.tsx | 216 -------------------------------------- 2 files changed, 216 insertions(+), 216 deletions(-) create mode 100644 app/sesh/newstartpage.tsx delete mode 100644 app/sesh/page.tsx diff --git a/app/sesh/newstartpage.tsx b/app/sesh/newstartpage.tsx new file mode 100644 index 0000000..bf4d2d0 --- /dev/null +++ b/app/sesh/newstartpage.tsx @@ -0,0 +1,216 @@ +/** + * + */ + +//@ts-ignore +'use client'; +import React, { useState, useEffect } from 'react'; +import { Form, Select, Input, Button, Typography, Divider, Steps } from 'antd'; +import { useRouter } from 'next/navigation'; +import { fetchLayouts, fetchSizes, fetchSets } from '../components/rest-api/api'; +import { ANGLES } from '@/app/lib/board-data'; +import { useBoardProvider } from '../components/board-provider/board-provider-context'; +import { LayoutRow, SetRow, SizeRow } from '../lib/data/queries'; +import { BoardName } from '../lib/types'; + +const { Option } = Select; +const { Text } = Typography; + +const CombinedWizard = () => { + const router = useRouter(); + const [form] = Form.useForm(); + const { login, isAuthenticated } = useBoardProvider(); + const [currentStep, setCurrentStep] = useState(0); + const [isLoggingIn, setIsLoggingIn] = useState(false); + + // Data states + const [layouts, setLayouts] = useState([]); + const [sizes, setSizes] = useState([]); + const [sets, setSets] = useState([]); + const [angles, setAngles] = useState([]); + + // Loading states + const [isLoadingLayouts, setIsLoadingLayouts] = useState(false); + const [isLoadingSizes, setIsLoadingSizes] = useState(false); + const [isLoadingSets, setIsLoadingSets] = useState(false); + + // Fetch layouts when board is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName'); + if (boardName) { + setIsLoadingLayouts(true); + fetchLayouts(boardName) + .then(setLayouts) + .finally(() => setIsLoadingLayouts(false)); + } + }, [form.getFieldValue('boardName')]); + + // Fetch sizes when layout is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName'); + const layoutId = form.getFieldValue('layoutId'); + if (boardName && layoutId) { + setIsLoadingSizes(true); + fetchSizes(boardName, layoutId) + .then(setSizes) + .finally(() => setIsLoadingSizes(false)); + } + }, [form.getFieldValue('layoutId')]); + + // Fetch sets when size is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName'); + const layoutId = form.getFieldValue('layoutId'); + const sizeId = form.getFieldValue('sizeId'); + if (boardName && layoutId && sizeId) { + setIsLoadingSets(true); + fetchSets(boardName, layoutId, sizeId) + .then(setSets) + .finally(() => setIsLoadingSets(false)); + } + }, [form.getFieldValue('sizeId')]); + + // Update angles when board is selected + useEffect(() => { + const boardName = form.getFieldValue('boardName') as BoardName; + if (boardName && ANGLES[boardName]) { + setAngles(ANGLES[boardName]); + } + }, [form.getFieldValue('boardName')]); + + const handleLogin = async () => { + const values = form.getFieldsValue(['username', 'password', 'boardName']); + if (!values.username || !values.password) return; + + setIsLoggingIn(true); + try { + await login(values.boardName, values.username, values.password); + } catch (error) { + console.error('Login failed:', error); + } finally { + setIsLoggingIn(false); + } + }; + //@ts-expect-error + const handleFinish = async (values) => { + const { boardName, layoutId, sizeId, setIds, angle } = values; + const setIdsString = Array.isArray(setIds) ? setIds.join(',') : setIds; + router.push(`/${boardName}/${layoutId}/${sizeId}/${setIdsString}/${angle}/list`); + }; + + const steps = [ + { title: 'Board Selection', content: 'boardName' }, + { title: 'Layout', content: 'layoutId' }, + { title: 'Size', content: 'sizeId' }, + { title: 'Sets', content: 'setIds' }, + { title: 'Angle', content: 'angle' }, + ]; + + return ( +
+ + +
+
+ + + + + {form.getFieldValue('boardName') && ( + <> + + Optional Login + + + {isAuthenticated ? ( +
+ Logged in to {form.getFieldValue('boardName')} board +
+ ) : ( + <> + + + + + + + + + )} + + )} +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + {currentStep < steps.length - 1 ? ( + + ) : ( + + )} +
+
+
+ ); +}; + +export default CombinedWizard; diff --git a/app/sesh/page.tsx b/app/sesh/page.tsx deleted file mode 100644 index 65e5d5f..0000000 --- a/app/sesh/page.tsx +++ /dev/null @@ -1,216 +0,0 @@ -// /** -// * -// */ - -// //@ts-ignore -// 'use client'; -// import React, { useState, useEffect } from 'react'; -// import { Form, Select, Input, Button, Typography, Divider, Steps } from 'antd'; -// import { useRouter } from 'next/navigation'; -// import { fetchLayouts, fetchSizes, fetchSets } from '../components/rest-api/api'; -// import { ANGLES } from '@/app/lib/board-data'; -// import { useBoardProvider } from '../components/board-provider/board-provider-context'; -// import { LayoutRow, SetRow, SizeRow } from '../lib/data/queries'; -// import { BoardName } from '../lib/types'; - -// const { Option } = Select; -// const { Text } = Typography; - -// const CombinedWizard = () => { -// const router = useRouter(); -// const [form] = Form.useForm(); -// const { login, isAuthenticated } = useBoardProvider(); -// const [currentStep, setCurrentStep] = useState(0); -// const [isLoggingIn, setIsLoggingIn] = useState(false); - -// // Data states -// const [layouts, setLayouts] = useState([]); -// const [sizes, setSizes] = useState([]); -// const [sets, setSets] = useState([]); -// const [angles, setAngles] = useState([]); - -// // Loading states -// const [isLoadingLayouts, setIsLoadingLayouts] = useState(false); -// const [isLoadingSizes, setIsLoadingSizes] = useState(false); -// const [isLoadingSets, setIsLoadingSets] = useState(false); - -// // Fetch layouts when board is selected -// useEffect(() => { -// const boardName = form.getFieldValue('boardName'); -// if (boardName) { -// setIsLoadingLayouts(true); -// fetchLayouts(boardName) -// .then(setLayouts) -// .finally(() => setIsLoadingLayouts(false)); -// } -// }, [form.getFieldValue('boardName')]); - -// // Fetch sizes when layout is selected -// useEffect(() => { -// const boardName = form.getFieldValue('boardName'); -// const layoutId = form.getFieldValue('layoutId'); -// if (boardName && layoutId) { -// setIsLoadingSizes(true); -// fetchSizes(boardName, layoutId) -// .then(setSizes) -// .finally(() => setIsLoadingSizes(false)); -// } -// }, [form.getFieldValue('layoutId')]); - -// // Fetch sets when size is selected -// useEffect(() => { -// const boardName = form.getFieldValue('boardName'); -// const layoutId = form.getFieldValue('layoutId'); -// const sizeId = form.getFieldValue('sizeId'); -// if (boardName && layoutId && sizeId) { -// setIsLoadingSets(true); -// fetchSets(boardName, layoutId, sizeId) -// .then(setSets) -// .finally(() => setIsLoadingSets(false)); -// } -// }, [form.getFieldValue('sizeId')]); - -// // Update angles when board is selected -// useEffect(() => { -// const boardName = form.getFieldValue('boardName') as BoardName; -// if (boardName && ANGLES[boardName]) { -// setAngles(ANGLES[boardName]); -// } -// }, [form.getFieldValue('boardName')]); - -// const handleLogin = async () => { -// const values = form.getFieldsValue(['username', 'password', 'boardName']); -// if (!values.username || !values.password) return; - -// setIsLoggingIn(true); -// try { -// await login(values.boardName, values.username, values.password); -// } catch (error) { -// console.error('Login failed:', error); -// } finally { -// setIsLoggingIn(false); -// } -// }; -// //@ts-expect-error -// const handleFinish = async (values) => { -// const { boardName, layoutId, sizeId, setIds, angle } = values; -// const setIdsString = Array.isArray(setIds) ? setIds.join(',') : setIds; -// router.push(`/${boardName}/${layoutId}/${sizeId}/${setIdsString}/${angle}/list`); -// }; - -// const steps = [ -// { title: 'Board Selection', content: 'boardName' }, -// { title: 'Layout', content: 'layoutId' }, -// { title: 'Size', content: 'sizeId' }, -// { title: 'Sets', content: 'setIds' }, -// { title: 'Angle', content: 'angle' }, -// ]; - -// return ( -//
-// - -//
-//
-// -// -// - -// {form.getFieldValue('boardName') && ( -// <> -// -// Optional Login -// - -// {isAuthenticated ? ( -//
-// Logged in to {form.getFieldValue('boardName')} board -//
-// ) : ( -// <> -// -// -// -// -// -// -// -// -// )} -// -// )} -//
- -//
-// -// -// -//
- -//
-// -// -// -//
- -//
-// -// -// -//
- -//
-// -// -// -//
- -//
-// -// {currentStep < steps.length - 1 ? ( -// -// ) : ( -// -// )} -//
-//
-//
-// ); -// }; - -// export default CombinedWizard;