export const mySchema = mysqlSchema('my')
export const categories = mySchema.table('categories', {
id: tinyint('id').primaryKey(),
name: varchar('name', { length: 256 }).notNull(),
})
export const items = mySchema.table('items', {
id: int('item_id').notNull().primaryKey(),
name: varchar('name', { length: 256 }).notNull(),
category: tinyint('category')
.notNull()
.references(() => categories.id, {
onDelete: 'cascade',
})
})
export const mySchema = mysqlSchema('my')
export const categories = mySchema.table('categories', {
id: tinyint('id').primaryKey(),
name: varchar('name', { length: 256 }).notNull(),
})
export const items = mySchema.table('items', {
id: int('item_id').notNull().primaryKey(),
name: varchar('name', { length: 256 }).notNull(),
category: tinyint('category')
.notNull()
.references(() => categories.id, {
onDelete: 'cascade',
})
})