Skip to content

Commit f9369ae

Browse files
authored
Merge pull request #431 from filipsobol/patch-3
2 parents 9b5cf9b + a0670c6 commit f9369ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drizzle-orm/src/sqlite-core/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ import { sqliteTable, foreignKey, primaryKey, text, integer, index, uniqueIndex,
252252

253253
export const countries = sqliteTable('countries', {
254254
id: integer('id').primaryKey(),
255-
name: text('name', { length: 256 }),
255+
name: text('name'),
256256
population: integer('population'),
257+
capital: integer('capital').references(() => cities.id, { onUpdate: 'cascade', onDelete: 'cascade' })
257258
}, (countries) => ({
258259
nameIdx: index('name_idx').on(countries.name), // one column
259260
namePopulationIdx: index('name_population_idx').on(countries.name, countries.population), // multiple columns
@@ -263,7 +264,7 @@ export const countries = sqliteTable('countries', {
263264

264265
export const cities = sqliteTable('cities', {
265266
id: integer('id').primaryKey(),
266-
name: text('name', { length: 256 }),
267+
name: text('name'),
267268
countryId: integer('country_id').references(() => countries.id), // inline foreign key
268269
countryName: text('country_id'),
269270
sisterCityId: integer('sister_city_id').references((): AnySQLiteColumn => cities.id), // self-referencing foreign key

0 commit comments

Comments
 (0)