Add unique constraints to featuredAdventures and worldTravelCountryRegions tables, and insert data for Canada, Germany, and the US regions.

This commit is contained in:
Sean Morley
2024-04-12 01:27:13 +00:00
parent 8a8a118309
commit a17234ab6b
11 changed files with 756 additions and 85 deletions

View File

@@ -11,7 +11,7 @@ import {
export const featuredAdventures = pgTable("featuredAdventures", {
id: serial("id").primaryKey(),
name: text("name").notNull(),
name: text("name").notNull().unique(),
location: text("location"),
});
@@ -63,7 +63,7 @@ export const worldTravelCountries = pgTable("worldTravelCountries", {
export const worldTravelCountryRegions = pgTable("worldTravelCountryRegions", {
id: serial("id").primaryKey(),
name: text("name").notNull(),
name: text("name").notNull().unique(),
country_code: text("country_code")
.notNull()
.references(() => worldTravelCountries.country_code),