diff --git a/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/view/[climb_uuid]/page.tsx b/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/view/[climb_uuid]/page.tsx index 3276a84..c3c4f92 100644 --- a/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/view/[climb_uuid]/page.tsx +++ b/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/view/[climb_uuid]/page.tsx @@ -9,10 +9,10 @@ import BetaVideos from '@/app/components/beta-videos/beta-videos'; import { constructClimbInfoUrl, extractUuidFromSlug, - constructClimbViewUrl, isUuidOnly, constructClimbViewUrlWithSlugs, parseBoardRouteParams, + constructClimbViewUrlWithDatabaseSlugs, } from '@/app/lib/url-utils'; import { parseBoardRouteParamsWithSlugs } from '@/app/lib/url-utils.server'; import { convertLitUpHoldsStringToMap } from '@/app/components/board-renderer/util'; @@ -34,7 +34,15 @@ export async function generateMetadata(props: { params: Promise m.getLayouts(parsedParams.board_name)); const sizes = await import('@/app/lib/data/queries').then((m) => - m.getSizes(parsedParams.board_name, parsedParams.layout_id), + m.getSizes(parsedParams.board_name, parseInt(parsedParams.layout_id)), ); const sets = await import('@/app/lib/data/queries').then((m) => - m.getSets(parsedParams.board_name, parsedParams.layout_id, parsedParams.size_id), + m.getSets(parsedParams.board_name, parseInt(parsedParams.layout_id), parseInt(parsedParams.size_id)), ); - const layout = layouts.find((l) => l.id === parsedParams.layout_id); - const size = sizes.find((s) => s.id === parsedParams.size_id); - const selectedSets = sets.filter((s) => parsedParams.set_ids.includes(s.id)); + const layout = layouts.find((l) => l.id === parseInt(parsedParams.layout_id)); + const size = sizes.find((s) => s.id === parseInt(parsedParams.size_id)); + const selectedSets = sets.filter((s) => parsedParams.set_ids.includes(s.id.toString())); if (layout && size && selectedSets.length > 0) { const newUrl = constructClimbViewUrlWithSlugs( @@ -189,7 +197,6 @@ export default async function DynamicResultsPage(props: { params: Promise { +}: Pick & { boardDetails?: BoardDetails }) => { const { climbSearchParams } = useQueueContext(); const climbListUrl = @@ -27,7 +23,7 @@ const BackToClimbList = ({ boardDetails.set_names, angle, ) - : `/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/list`; + : (() => { throw new Error('Board details are missing required slug information'); })(); return ( diff --git a/app/components/board-page/header.tsx b/app/components/board-page/header.tsx index edefd4d..c992e35 100644 --- a/app/components/board-page/header.tsx +++ b/app/components/board-page/header.tsx @@ -31,18 +31,18 @@ export default function BoardSeshHeader({ boardDetails, angle }: BoardSeshHeader style={{ height: '8dvh', background: '#fff', - padding: '0 16px', }} > - + {/* Column for the "BS" logo (25% width) */} - + - + <Title level={4} align="left" style={{ cursor: 'pointer' }}> BS + diff --git a/app/components/climb-card/climb-card-actions.tsx b/app/components/climb-card/climb-card-actions.tsx index bc67352..f497c8a 100644 --- a/app/components/climb-card/climb-card-actions.tsx +++ b/app/components/climb-card/climb-card-actions.tsx @@ -4,7 +4,9 @@ import { useQueueContext } from '../queue-control/queue-context'; import { BoardDetails, Climb } from '@/app/lib/types'; import { PlusCircleOutlined, HeartOutlined, InfoCircleOutlined, CheckCircleOutlined } from '@ant-design/icons'; import Link from 'next/link'; -import { constructClimbViewUrl, constructClimbViewUrlWithSlugs } from '@/app/lib/url-utils'; +import { + constructClimbViewUrlWithSlugs, +} from '@/app/lib/url-utils'; import { track } from '@vercel/analytics'; import { message } from 'antd'; @@ -50,27 +52,16 @@ const ClimbCardActions = ({ climb, boardDetails }: ClimbCardActionsProps) => { { track('Climb Info Viewed', { diff --git a/app/components/climb-card/climb-thumbnail.tsx b/app/components/climb-card/climb-thumbnail.tsx index b51ca37..aaeba8d 100644 --- a/app/components/climb-card/climb-thumbnail.tsx +++ b/app/components/climb-card/climb-thumbnail.tsx @@ -4,7 +4,7 @@ import Link from 'next/link'; import { BoardDetails, Climb } from '@/app/lib/types'; import BoardRenderer from '../board-renderer/board-renderer'; import ClimbCardModal from './climb-card-modal'; -import { constructClimbViewUrl, constructClimbViewUrlWithSlugs, parseBoardRouteParams } from '@/app/lib/url-utils'; +import { constructClimbViewUrlWithSlugs } from '@/app/lib/url-utils'; type ClimbThumbnailProps = { currentClimb: Climb | null; @@ -28,26 +28,16 @@ const ClimbThumbnail = ({ boardDetails, currentClimb, enableNavigation = false, if (enableNavigation && currentClimb) { // Use slug-based URL construction if slug names are available - const climbViewUrl = boardDetails.layout_name && boardDetails.size_name && boardDetails.set_names - ? constructClimbViewUrlWithSlugs( + const climbViewUrl = constructClimbViewUrlWithSlugs( boardDetails.board_name, - boardDetails.layout_name, - boardDetails.size_name, - boardDetails.set_names, + boardDetails.layout_name || '', + boardDetails.size_name || '', + boardDetails.set_names || [], currentClimb.angle, currentClimb.uuid, currentClimb.name - ) - : (() => { - const routeParams = parseBoardRouteParams({ - board_name: boardDetails.board_name, - layout_id: boardDetails.layout_id.toString(), - size_id: boardDetails.size_id.toString(), - set_ids: boardDetails.set_ids.join(','), - angle: currentClimb.angle.toString(), - }); - return constructClimbViewUrl(routeParams, currentClimb.uuid, currentClimb.name); - })(); + ); + return ( diff --git a/app/components/climb-view/climb-view-actions.tsx b/app/components/climb-view/climb-view-actions.tsx index 9475c21..cd03cec 100644 --- a/app/components/climb-view/climb-view-actions.tsx +++ b/app/components/climb-view/climb-view-actions.tsx @@ -96,8 +96,8 @@ const ClimbViewActions = ({ climb, boardDetails, auroraAppUrl, angle }: ClimbVie return constructClimbListWithSlugs(board_name, layout_name, size_name, set_names, angle); } - // Fallback to numeric format - return `/${board_name}/${boardDetails.layout_id}/${boardDetails.size_id}/${boardDetails.set_ids.join(',')}/${angle}/list`; + // This should not happen as boardDetails should always have the necessary fields + throw new Error('Board details are missing required slug information'); }; // Define menu items for the meatball menu (overflow actions on mobile) diff --git a/app/components/queue-control/next-climb-button.tsx b/app/components/queue-control/next-climb-button.tsx index b777510..2d5dcba 100644 --- a/app/components/queue-control/next-climb-button.tsx +++ b/app/components/queue-control/next-climb-button.tsx @@ -19,8 +19,7 @@ const NextButton = (props: ButtonProps) => ( export default function NextClimbButton({ navigate = false, boardDetails }: NextClimbButtonProps) { const { setCurrentClimbQueueItem, getNextClimbQueueItem, viewOnlyMode } = useQueueContext(); // Assuming setSuggestedQueue is available - const { board_name, layout_id, size_id, set_ids, angle } = - parseBoardRouteParams(useParams()); + const { angle } = parseBoardRouteParams(useParams()); const nextClimb = getNextClimbQueueItem(); @@ -47,7 +46,7 @@ export default function NextClimbButton({ navigate = false, boardDetails }: Next nextClimb.climb.uuid, nextClimb.climb.name, ) - : `/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/view/${nextClimb.climb.uuid}`; + : (() => { throw new Error('Board details are missing required slug information'); })(); return ( ( export default function PreviousClimbButton({ navigate = false, boardDetails }: PreviousClimbButtonProps) { const { getPreviousClimbQueueItem, setCurrentClimbQueueItem, viewOnlyMode } = useQueueContext(); - const { board_name, layout_id, size_id, set_ids, angle } = - parseBoardRouteParams(useParams()); + const { angle } = parseBoardRouteParams(useParams()); const previousClimb = getPreviousClimbQueueItem(); @@ -48,7 +47,7 @@ export default function PreviousClimbButton({ navigate = false, boardDetails }: previousClimb.climb.uuid, previousClimb.climb.name, ) - : `/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/view/${previousClimb.climb.uuid}`; + : (() => { throw new Error('Board details are missing required slug information'); })(); return ( { const layouts = await sql` - SELECT id, name + SELECT id, name, slug FROM ${sql.unsafe(getTableName(board_name, 'layouts'))} layouts WHERE is_listed = true AND password IS NULL @@ -234,11 +235,12 @@ export type SizeRow = { id: number; name: string; description: string; + slug: string; }; export const getSizes = async (board_name: BoardName, layout_id: LayoutId) => { const layouts = await sql` - SELECT product_sizes.id, product_sizes.name, product_sizes.description + SELECT product_sizes.id, product_sizes.name, product_sizes.description, product_sizes.slug FROM ${sql.unsafe(getTableName(board_name, 'product_sizes'))} product_sizes INNER JOIN ${sql.unsafe(getTableName(board_name, 'layouts'))} layouts ON product_sizes.product_id = layouts.product_id WHERE layouts.id = ${layout_id} @@ -249,11 +251,12 @@ export const getSizes = async (board_name: BoardName, layout_id: LayoutId) => { export type SetRow = { id: number; name: string; + slug: string; }; export const getSets = async (board_name: BoardName, layout_id: LayoutId, size_id: Size) => { const layouts = await sql` - SELECT sets.id, sets.name + SELECT sets.id, sets.name, sets.slug FROM ${sql.unsafe(getTableName(board_name, 'sets'))} sets INNER JOIN ${sql.unsafe(getTableName(board_name, 'product_sizes_layouts_sets'))} psls ON sets.id = psls.set_id diff --git a/app/lib/db/schema.ts b/app/lib/db/schema.ts index 29eb16e..794e71c 100644 --- a/app/lib/db/schema.ts +++ b/app/lib/db/schema.ts @@ -49,21 +49,25 @@ export const kilterLayouts = pgTable( id: integer().primaryKey().notNull(), productId: integer('product_id'), name: text(), + slug: text(), instagramCaption: text('instagram_caption'), isMirrored: boolean('is_mirrored'), isListed: boolean('is_listed'), password: text(), createdAt: text('created_at'), }, - (table) => [ - foreignKey({ + (table) => ({ + // Indexes + slugIdx: index('kilter_layouts_slug_idx').on(table.slug), + // Foreign Keys + productFk: foreignKey({ columns: [table.productId], foreignColumns: [kilterProducts.id], name: 'layouts_product_id_fkey1', }) .onUpdate('cascade') .onDelete('cascade'), - ], + }), ); export const kilterAndroidMetadata = pgTable('kilter_android_metadata', { @@ -203,20 +207,24 @@ export const kilterProductSizes = pgTable( edgeBottom: integer('edge_bottom'), edgeTop: integer('edge_top'), name: text(), + slug: text(), description: text(), imageFilename: text('image_filename'), position: integer(), isListed: boolean('is_listed'), }, - (table) => [ - foreignKey({ + (table) => ({ + // Indexes + slugIdx: index('kilter_product_sizes_slug_idx').on(table.slug), + // Foreign Keys + productFk: foreignKey({ columns: [table.productId], foreignColumns: [kilterProducts.id], name: 'product_sizes_product_id_fkey1', }) .onUpdate('cascade') .onDelete('cascade'), - ], + }), ); export const kilterKits = pgTable('kilter_kits', { @@ -452,8 +460,12 @@ export const kilterProducts = pgTable('kilter_products', { export const kilterSets = pgTable('kilter_sets', { id: integer().primaryKey().notNull(), name: text(), + slug: text(), hsm: integer(), -}); +}, (table) => ({ + // Indexes + slugIdx: index('kilter_sets_slug_idx').on(table.slug), +})); export const kilterWalls = pgTable( 'kilter_walls', @@ -679,8 +691,12 @@ export const tensionClimbHolds = pgTable( export const tensionSets = pgTable('tension_sets', { id: integer().primaryKey().notNull(), name: text(), + slug: text(), hsm: integer(), -}); +}, (table) => ({ + // Indexes + slugIdx: index('tension_sets_slug_idx').on(table.slug), +})); export const tensionPlacements = pgTable( 'tension_placements', @@ -777,21 +793,25 @@ export const tensionLayouts = pgTable( id: integer().primaryKey().notNull(), productId: integer('product_id'), name: text(), + slug: text(), instagramCaption: text('instagram_caption'), isMirrored: boolean('is_mirrored'), isListed: boolean('is_listed'), password: text(), createdAt: text('created_at'), }, - (table) => [ - foreignKey({ + (table) => ({ + // Indexes + slugIdx: index('tension_layouts_slug_idx').on(table.slug), + // Foreign Keys + productFk: foreignKey({ columns: [table.productId], foreignColumns: [tensionProducts.id], name: 'layouts_product_id_fkey', }) .onUpdate('cascade') .onDelete('cascade'), - ], + }), ); export const tensionSharedSyncs = pgTable('tension_shared_syncs', { @@ -844,20 +864,24 @@ export const tensionProductSizes = pgTable( edgeBottom: integer('edge_bottom'), edgeTop: integer('edge_top'), name: text(), + slug: text(), description: text(), imageFilename: text('image_filename'), position: integer(), isListed: boolean('is_listed'), }, - (table) => [ - foreignKey({ + (table) => ({ + // Indexes + slugIdx: index('tension_product_sizes_slug_idx').on(table.slug), + // Foreign Keys + productFk: foreignKey({ columns: [table.productId], foreignColumns: [tensionProducts.id], name: 'product_sizes_product_id_fkey', }) .onUpdate('cascade') .onDelete('cascade'), - ], + }), ); export const kilterAscents = pgTable( diff --git a/app/lib/slug-utils.ts b/app/lib/slug-utils.ts index 6c22eda..f38cc1d 100644 --- a/app/lib/slug-utils.ts +++ b/app/lib/slug-utils.ts @@ -4,17 +4,20 @@ import { BoardName, LayoutId, Size } from '@/app/lib/types'; export type LayoutRow = { id: number; name: string; + slug: string; }; export type SizeRow = { id: number; name: string; description: string; + slug: string; }; export type SetRow = { id: number; name: string; + slug: string; }; const getTableName = (board_name: string, table_name: string) => { @@ -30,38 +33,14 @@ const getTableName = (board_name: string, table_name: string) => { // Reverse lookup functions for slug to ID conversion export const getLayoutBySlug = async (board_name: BoardName, slug: string): Promise => { const rows = (await sql` - SELECT id, name + SELECT id, name, slug FROM ${sql.unsafe(getTableName(board_name, 'layouts'))} layouts WHERE is_listed = true AND password IS NULL + AND slug = ${slug} `) as LayoutRow[]; - const layout = rows.find((l) => { - const baseSlug = l.name - .toLowerCase() - .trim() - .replace(/^(kilter|tension|decoy)\s+board\s+/i, '') // Remove board name prefix - .replace(/[^\w\s-]/g, '') - .replace(/\s+/g, '-') - .replace(/-+/g, '-') - .replace(/^-|-$/g, ''); - - let layoutSlug = baseSlug; - - // Handle Tension board specific cases - if (baseSlug === 'original-layout') { - layoutSlug = 'original'; - } - - // Replace numbers with words for better readability - if (baseSlug.startsWith('2-')) { - layoutSlug = baseSlug.replace('2-', 'two-'); - } - - return layoutSlug === slug; - }); - - return layout || null; + return rows[0] || null; }; export const getSizeBySlug = async ( @@ -70,32 +49,14 @@ export const getSizeBySlug = async ( slug: string, ): Promise => { const rows = (await sql` - SELECT product_sizes.id, product_sizes.name, product_sizes.description + SELECT product_sizes.id, product_sizes.name, product_sizes.description, product_sizes.slug FROM ${sql.unsafe(getTableName(board_name, 'product_sizes'))} product_sizes INNER JOIN ${sql.unsafe(getTableName(board_name, 'layouts'))} layouts ON product_sizes.product_id = layouts.product_id WHERE layouts.id = ${layout_id} + AND product_sizes.slug = ${slug} `) as SizeRow[]; - const size = rows.find((s) => { - // Try to match size dimensions first (e.g., "12x12" matches "12 x 12 Commercial") - const sizeMatch = s.name.match(/(\d+)\s*x\s*(\d+)/i); - if (sizeMatch) { - const expectedSlug = `${sizeMatch[1]}x${sizeMatch[2]}`; - if (expectedSlug === slug) return true; - } - - // Fallback to general slug matching - const sizeSlug = s.name - .toLowerCase() - .trim() - .replace(/[^\w\s-]/g, '') - .replace(/\s+/g, '-') - .replace(/-+/g, '-') - .replace(/^-|-$/g, ''); - return sizeSlug === slug; - }); - - return size || null; + return rows[0] || null; }; export const getSetsBySlug = async ( @@ -104,49 +65,18 @@ export const getSetsBySlug = async ( size_id: Size, slug: string, ): Promise => { + // Parse the slug to get individual set slugs + const slugParts = slug.split('_'); // Split by underscore + const rows = (await sql` - SELECT sets.id, sets.name + SELECT sets.id, sets.name, sets.slug FROM ${sql.unsafe(getTableName(board_name, 'sets'))} sets INNER JOIN ${sql.unsafe(getTableName(board_name, 'product_sizes_layouts_sets'))} psls ON sets.id = psls.set_id WHERE psls.product_size_id = ${size_id} AND psls.layout_id = ${layout_id} + AND sets.slug = ANY(${slugParts}) `) as SetRow[]; - // Parse the slug to get individual set names - const slugParts = slug.split('_'); // Split by underscore now - const matchingSets = rows.filter((s) => { - const lowercaseName = s.name.toLowerCase().trim(); - - // Handle homewall-specific set names - if ( - lowercaseName.includes('auxiliary') && - lowercaseName.includes('kickboard') && - slugParts.includes('aux-kicker') - ) { - return true; - } - if ( - lowercaseName.includes('mainline') && - lowercaseName.includes('kickboard') && - slugParts.includes('main-kicker') - ) { - return true; - } - if (lowercaseName.includes('auxiliary') && slugParts.includes('aux')) { - return true; - } - if (lowercaseName.includes('mainline') && slugParts.includes('main')) { - return true; - } - - // Handle original kilter/tension set names - const setSlug = lowercaseName - .replace(/\s+ons?$/i, '') // Remove "on" or "ons" suffix - .replace(/^(bolt|screw).*/, '$1') // Extract just "bolt" or "screw" - .replace(/\s+/g, '-'); // Replace spaces with hyphens - return slugParts.includes(setSlug); - }); - - return matchingSets; + return rows; }; diff --git a/app/lib/types.ts b/app/lib/types.ts index bf26afb..b5547dc 100644 --- a/app/lib/types.ts +++ b/app/lib/types.ts @@ -118,9 +118,9 @@ export type BoardRouteParametersWithUuid = BoardRouteParameters & { export type ParsedBoardRouteParameters = { board_name: BoardName; - layout_id: number; - size_id: number; - set_ids: SetIdList; + layout_id: string; + size_id: string; + set_ids: string; angle: number; uuid?: string; }; diff --git a/app/lib/url-utils.ts b/app/lib/url-utils.ts index 0e1f726..0e849a8 100644 --- a/app/lib/url-utils.ts +++ b/app/lib/url-utils.ts @@ -6,7 +6,6 @@ import { SearchRequestPagination, ClimbUuid, BoardDetails, - Angle, } from '@/app/lib/types'; import { PAGE_LIMIT } from '../components/board-page/constants'; @@ -125,22 +124,32 @@ export const parsedRouteSearchParamsToSearchParams = (urlParams: SearchRequestPa }; }; -export const constructClimbViewUrl = ( - { board_name, layout_id, angle, size_id, set_ids }: ParsedBoardRouteParameters, +// DEPRECATED: Use constructClimbViewUrlWithSlugs instead +export const constructClimbViewUrl = () => { + throw new Error('constructClimbViewUrl is deprecated. Use constructClimbViewUrlWithSlugs instead.'); +}; + +// Direct slug-based URL construction (when slugs are already available from database) +export const constructClimbViewUrlWithDatabaseSlugs = ( + board_name: string, + layoutSlug: string, + sizeSlug: string, + setSlug: string, + angle: number, climb_uuid: ClimbUuid, climbName?: string, ) => { - const baseUrl = `/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/view/`; + const baseUrl = `/${board_name}/${layoutSlug}/${sizeSlug}/${setSlug}/${angle}/view/`; if (climbName && climbName.trim()) { - const slug = generateClimbSlug(climbName.trim()); - if (slug) { - return `${baseUrl}${slug}-${climb_uuid}`; + const climbSlug = generateClimbSlug(climbName.trim()); + if (climbSlug) { + return `${baseUrl}${climbSlug}-${climb_uuid}`; } } return `${baseUrl}${climb_uuid}`; }; -// New function to construct URLs with slug-based board parameters +// Legacy function to construct URLs with slug-based board parameters (generates slugs from names) export const constructClimbViewUrlWithSlugs = ( board_name: string, layoutName: string, @@ -154,34 +163,38 @@ export const constructClimbViewUrlWithSlugs = ( const sizeSlug = generateSizeSlug(sizeName); const setSlug = generateSetSlug(setNames); - const baseUrl = `/${board_name}/${layoutSlug}/${sizeSlug}/${setSlug}/${angle}/view/`; - if (climbName && climbName.trim()) { - const climbSlug = generateClimbSlug(climbName.trim()); - if (climbSlug) { - return `${baseUrl}${climbSlug}-${climb_uuid}`; - } - } - return `${baseUrl}${climb_uuid}`; + return constructClimbViewUrlWithDatabaseSlugs(board_name, layoutSlug, sizeSlug, setSlug, angle, climb_uuid, climbName); }; export const constructClimbInfoUrl = ( { board_name }: BoardDetails, climb_uuid: ClimbUuid, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - angle: Angle, ) => `https://${board_name}boardapp${board_name === 'tension' ? '2' : ''}.com/climbs/${climb_uuid}`; //`/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/info/${climb_uuid}`; -export const constructClimbList = ({ board_name, layout_id, angle, size_id, set_ids }: ParsedBoardRouteParameters) => - `/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/list`; +// DEPRECATED: Use constructClimbListWithSlugs instead +export const constructClimbList = () => { + throw new Error('constructClimbList is deprecated. Use constructClimbListWithSlugs instead.'); +}; export const constructClimbSearchUrl = ( { board_name, layout_id, angle, size_id, set_ids }: ParsedBoardRouteParameters, queryString: string, ) => `/api/v1/${board_name}/${layout_id}/${size_id}/${set_ids}/${angle}/search?${queryString}`; -// New slug-based URL construction functions +// Direct slug-based URL construction (when slugs are already available from database) +export const constructClimbListWithDatabaseSlugs = ( + board_name: string, + layoutSlug: string, + sizeSlug: string, + setSlug: string, + angle: number, +) => { + return `/${board_name}/${layoutSlug}/${sizeSlug}/${setSlug}/${angle}/list`; +}; + +// Legacy slug-based URL construction functions (generates slugs from names) export const constructClimbListWithSlugs = ( board_name: string, layoutName: string, @@ -192,7 +205,7 @@ export const constructClimbListWithSlugs = ( const layoutSlug = generateLayoutSlug(layoutName); const sizeSlug = generateSizeSlug(sizeName); const setSlug = generateSetSlug(setNames); - return `/${board_name}/${layoutSlug}/${sizeSlug}/${setSlug}/${angle}/list`; + return constructClimbListWithDatabaseSlugs(board_name, layoutSlug, sizeSlug, setSlug, angle); }; export const generateClimbSlug = (climbName: string): string => { diff --git a/drizzle/0015_burly_longshot.sql b/drizzle/0015_burly_longshot.sql new file mode 100644 index 0000000..0c2a120 --- /dev/null +++ b/drizzle/0015_burly_longshot.sql @@ -0,0 +1,6 @@ +ALTER TABLE "kilter_layouts" ADD COLUMN "slug" text;--> statement-breakpoint +ALTER TABLE "kilter_product_sizes" ADD COLUMN "slug" text;--> statement-breakpoint +ALTER TABLE "kilter_sets" ADD COLUMN "slug" text;--> statement-breakpoint +ALTER TABLE "tension_layouts" ADD COLUMN "slug" text;--> statement-breakpoint +ALTER TABLE "tension_product_sizes" ADD COLUMN "slug" text;--> statement-breakpoint +ALTER TABLE "tension_sets" ADD COLUMN "slug" text; \ No newline at end of file diff --git a/drizzle/0016_serious_madrox.sql b/drizzle/0016_serious_madrox.sql new file mode 100644 index 0000000..addab0d --- /dev/null +++ b/drizzle/0016_serious_madrox.sql @@ -0,0 +1,6 @@ +CREATE INDEX "kilter_layouts_slug_idx" ON "kilter_layouts" USING btree ("slug");--> statement-breakpoint +CREATE INDEX "kilter_product_sizes_slug_idx" ON "kilter_product_sizes" USING btree ("slug");--> statement-breakpoint +CREATE INDEX "kilter_sets_slug_idx" ON "kilter_sets" USING btree ("slug");--> statement-breakpoint +CREATE INDEX "tension_layouts_slug_idx" ON "tension_layouts" USING btree ("slug");--> statement-breakpoint +CREATE INDEX "tension_product_sizes_slug_idx" ON "tension_product_sizes" USING btree ("slug");--> statement-breakpoint +CREATE INDEX "tension_sets_slug_idx" ON "tension_sets" USING btree ("slug"); \ No newline at end of file diff --git a/drizzle/0017_populate_slugs.sql b/drizzle/0017_populate_slugs.sql new file mode 100644 index 0000000..d7ae510 --- /dev/null +++ b/drizzle/0017_populate_slugs.sql @@ -0,0 +1,173 @@ +-- Populate slug columns with computed values from name fields + +-- Update kilter_layouts slugs +UPDATE kilter_layouts +SET slug = ( + CASE + -- Handle Tension board specific cases first + WHEN LOWER(TRIM(REGEXP_REPLACE(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'), '[^\w\s-]', '', 'g'))) = 'original-layout' + THEN 'original' + -- Replace numbers with words for better readability + WHEN LOWER(TRIM(REGEXP_REPLACE(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'), '[^\w\s-]', '', 'g'))) LIKE '2-%' + THEN REGEXP_REPLACE(LOWER(TRIM(REGEXP_REPLACE(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'), '[^\w\s-]', '', 'g'))), '^2-', 'two-', 'g') + ELSE + -- Standard slug generation + TRIM(REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + LOWER(TRIM(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'))), + '[^\w\s-]', '', 'g' + ), + '\s+', '-', 'g' + ), + '-+', '-', 'g' + ), + '^-|-$', '', 'g' + )) + END +) +WHERE name IS NOT NULL AND slug IS NULL; + +-- Update tension_layouts slugs +UPDATE tension_layouts +SET slug = ( + CASE + -- Handle Tension board specific cases first + WHEN LOWER(TRIM(REGEXP_REPLACE(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'), '[^\w\s-]', '', 'g'))) = 'original-layout' + THEN 'original' + -- Replace numbers with words for better readability + WHEN LOWER(TRIM(REGEXP_REPLACE(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'), '[^\w\s-]', '', 'g'))) LIKE '2-%' + THEN REGEXP_REPLACE(LOWER(TRIM(REGEXP_REPLACE(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'), '[^\w\s-]', '', 'g'))), '^2-', 'two-', 'g') + ELSE + -- Standard slug generation + TRIM(REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + LOWER(TRIM(REGEXP_REPLACE(name, '^(kilter|tension|decoy)\s+board\s+', '', 'gi'))), + '[^\w\s-]', '', 'g' + ), + '\s+', '-', 'g' + ), + '-+', '-', 'g' + ), + '^-|-$', '', 'g' + )) + END +) +WHERE name IS NOT NULL AND slug IS NULL; + +-- Update kilter_product_sizes slugs +UPDATE kilter_product_sizes +SET slug = ( + CASE + -- Extract size dimensions (e.g., "12 x 12 Commercial" -> "12x12") + WHEN name ~ '\d+\s*x\s*\d+' + THEN REGEXP_REPLACE(name, '.*?(\d+)\s*x\s*(\d+).*', '\1x\2', 'i') + ELSE + -- Fallback to general slug generation + TRIM(REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + LOWER(TRIM(name)), + '[^\w\s-]', '', 'g' + ), + '\s+', '-', 'g' + ), + '-+', '-', 'g' + ), + '^-|-$', '', 'g' + )) + END +) +WHERE name IS NOT NULL AND slug IS NULL; + +-- Update tension_product_sizes slugs +UPDATE tension_product_sizes +SET slug = ( + CASE + -- Extract size dimensions (e.g., "12 x 12 Commercial" -> "12x12") + WHEN name ~ '\d+\s*x\s*\d+' + THEN REGEXP_REPLACE(name, '.*?(\d+)\s*x\s*(\d+).*', '\1x\2', 'i') + ELSE + -- Fallback to general slug generation + TRIM(REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + REGEXP_REPLACE( + LOWER(TRIM(name)), + '[^\w\s-]', '', 'g' + ), + '\s+', '-', 'g' + ), + '-+', '-', 'g' + ), + '^-|-$', '', 'g' + )) + END +) +WHERE name IS NOT NULL AND slug IS NULL; + +-- Update kilter_sets slugs +UPDATE kilter_sets +SET slug = ( + CASE + -- Handle homewall-specific set names + WHEN LOWER(TRIM(name)) LIKE '%auxiliary%' AND LOWER(TRIM(name)) LIKE '%kickboard%' + THEN 'aux-kicker' + WHEN LOWER(TRIM(name)) LIKE '%mainline%' AND LOWER(TRIM(name)) LIKE '%kickboard%' + THEN 'main-kicker' + WHEN LOWER(TRIM(name)) LIKE '%auxiliary%' + THEN 'aux' + WHEN LOWER(TRIM(name)) LIKE '%mainline%' + THEN 'main' + -- Handle original kilter/tension set names + WHEN LOWER(TRIM(name)) LIKE 'bolt%' + THEN 'bolt' + WHEN LOWER(TRIM(name)) LIKE 'screw%' + THEN 'screw' + ELSE + -- Standard processing: remove "on"/"ons" suffix and replace spaces + TRIM(REGEXP_REPLACE( + REGEXP_REPLACE( + LOWER(TRIM(name)), + '\s+ons?$', '', 'gi' + ), + '\s+', '-', 'g' + )) + END +) +WHERE name IS NOT NULL AND slug IS NULL; + +-- Update tension_sets slugs +UPDATE tension_sets +SET slug = ( + CASE + -- Handle homewall-specific set names + WHEN LOWER(TRIM(name)) LIKE '%auxiliary%' AND LOWER(TRIM(name)) LIKE '%kickboard%' + THEN 'aux-kicker' + WHEN LOWER(TRIM(name)) LIKE '%mainline%' AND LOWER(TRIM(name)) LIKE '%kickboard%' + THEN 'main-kicker' + WHEN LOWER(TRIM(name)) LIKE '%auxiliary%' + THEN 'aux' + WHEN LOWER(TRIM(name)) LIKE '%mainline%' + THEN 'main' + -- Handle original kilter/tension set names + WHEN LOWER(TRIM(name)) LIKE 'bolt%' + THEN 'bolt' + WHEN LOWER(TRIM(name)) LIKE 'screw%' + THEN 'screw' + ELSE + -- Standard processing: remove "on"/"ons" suffix and replace spaces + TRIM(REGEXP_REPLACE( + REGEXP_REPLACE( + LOWER(TRIM(name)), + '\s+ons?$', '', 'gi' + ), + '\s+', '-', 'g' + )) + END +) +WHERE name IS NOT NULL AND slug IS NULL; \ No newline at end of file diff --git a/drizzle/meta/0015_snapshot.json b/drizzle/meta/0015_snapshot.json new file mode 100644 index 0000000..55003fe --- /dev/null +++ b/drizzle/meta/0015_snapshot.json @@ -0,0 +1,4242 @@ +{ + "id": "3d5121cd-897f-41ae-9ee0-c6ea07174f90", + "prevId": "9c689779-3005-49b1-b4af-1cf1c8a97fcb", + "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 + }, + "slug": { + "name": "slug", + "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 + }, + "slug": { + "name": "slug", + "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 + }, + "slug": { + "name": "slug", + "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 + }, + "slug": { + "name": "slug", + "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 + }, + "slug": { + "name": "slug", + "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 + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_shared_syncs": { + "name": "tension_shared_syncs", + "schema": "", + "columns": { + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_tags": { + "name": "tension_tags", + "schema": "", + "columns": { + "entity_uuid": { + "name": "entity_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_user_permissions": { + "name": "tension_user_permissions", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_user_syncs": { + "name": "tension_user_syncs", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_syncs_user_id_fkey": { + "name": "user_syncs_user_id_fkey", + "tableFrom": "tension_user_syncs", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "tension_user_sync_pk": { + "name": "tension_user_sync_pk", + "columns": [ + "user_id", + "table_name" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_users": { + "name": "tension_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_walls": { + "name": "tension_walls", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "serial_number": { + "name": "serial_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "walls_layout_id_fkey": { + "name": "walls_layout_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_id_fkey": { + "name": "walls_product_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_size_id_fkey": { + "name": "walls_product_size_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_user_id_fkey": { + "name": "walls_user_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_walls_sets": { + "name": "tension_walls_sets", + "schema": "", + "columns": { + "wall_uuid": { + "name": "wall_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "walls_sets_set_id_fkey": { + "name": "walls_sets_set_id_fkey", + "tableFrom": "tension_walls_sets", + "tableTo": "tension_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_sets_wall_uuid_fkey": { + "name": "walls_sets_wall_uuid_fkey", + "tableFrom": "tension_walls_sets", + "tableTo": "tension_walls", + "columnsFrom": [ + "wall_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/0016_snapshot.json b/drizzle/meta/0016_snapshot.json new file mode 100644 index 0000000..6ba1614 --- /dev/null +++ b/drizzle/meta/0016_snapshot.json @@ -0,0 +1,4338 @@ +{ + "id": "a27ccd32-7b80-474e-adde-cd6ad161c13d", + "prevId": "3d5121cd-897f-41ae-9ee0-c6ea07174f90", + "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 + }, + "slug": { + "name": "slug", + "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": { + "kilter_layouts_slug_idx": { + "name": "kilter_layouts_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "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 + }, + "slug": { + "name": "slug", + "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": { + "kilter_product_sizes_slug_idx": { + "name": "kilter_product_sizes_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "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 + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "kilter_sets_slug_idx": { + "name": "kilter_sets_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "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 + }, + "slug": { + "name": "slug", + "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": { + "tension_layouts_slug_idx": { + "name": "tension_layouts_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "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 + }, + "slug": { + "name": "slug", + "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": { + "tension_product_sizes_slug_idx": { + "name": "tension_product_sizes_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "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 + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tension_sets_slug_idx": { + "name": "tension_sets_slug_idx", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_shared_syncs": { + "name": "tension_shared_syncs", + "schema": "", + "columns": { + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_tags": { + "name": "tension_tags", + "schema": "", + "columns": { + "entity_uuid": { + "name": "entity_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_listed": { + "name": "is_listed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_user_permissions": { + "name": "tension_user_permissions", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_user_syncs": { + "name": "tension_user_syncs", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "table_name": { + "name": "table_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_synchronized_at": { + "name": "last_synchronized_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_syncs_user_id_fkey": { + "name": "user_syncs_user_id_fkey", + "tableFrom": "tension_user_syncs", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "tension_user_sync_pk": { + "name": "tension_user_sync_pk", + "columns": [ + "user_id", + "table_name" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_users": { + "name": "tension_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_walls": { + "name": "tension_walls", + "schema": "", + "columns": { + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "product_id": { + "name": "product_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "angle": { + "name": "angle", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "layout_id": { + "name": "layout_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "product_size_id": { + "name": "product_size_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "hsm": { + "name": "hsm", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "serial_number": { + "name": "serial_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "walls_layout_id_fkey": { + "name": "walls_layout_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_layouts", + "columnsFrom": [ + "layout_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_id_fkey": { + "name": "walls_product_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_products", + "columnsFrom": [ + "product_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_product_size_id_fkey": { + "name": "walls_product_size_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_product_sizes", + "columnsFrom": [ + "product_size_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_user_id_fkey": { + "name": "walls_user_id_fkey", + "tableFrom": "tension_walls", + "tableTo": "tension_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tension_walls_sets": { + "name": "tension_walls_sets", + "schema": "", + "columns": { + "wall_uuid": { + "name": "wall_uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "walls_sets_set_id_fkey": { + "name": "walls_sets_set_id_fkey", + "tableFrom": "tension_walls_sets", + "tableTo": "tension_sets", + "columnsFrom": [ + "set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "cascade" + }, + "walls_sets_wall_uuid_fkey": { + "name": "walls_sets_wall_uuid_fkey", + "tableFrom": "tension_walls_sets", + "tableTo": "tension_walls", + "columnsFrom": [ + "wall_uuid" + ], + "columnsTo": [ + "uuid" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 5e518cb..33ddd72 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -106,6 +106,27 @@ "when": 1741938194000, "tag": "0014_add_missing_primary_keys", "breakpoints": true + }, + { + "idx": 15, + "version": "7", + "when": 1752328357970, + "tag": "0015_burly_longshot", + "breakpoints": true + }, + { + "idx": 16, + "version": "7", + "when": 1752328667394, + "tag": "0016_serious_madrox", + "breakpoints": true + }, + { + "idx": 17, + "version": "7", + "when": 1752328800000, + "tag": "0017_populate_slugs", + "breakpoints": true } ] -} +} \ No newline at end of file