import { sqliteTable, text, numeric, uniqueIndex, integer } from 'drizzle-orm/sqlite-core';
import { sql } from 'drizzle-orm';
export const blogPosts = sqliteTable(
'blog-posts',
{
id: integer('id').primaryKey().notNull(),
name: text('name').notNull(),
headline: text('headline').notNull(),
body: text('body').notNull(),
createdAt: integer('created_at')
.default(sql`(cast (unixepoch() as int))`)
.notNull()
},
(table) => {
return {
idUnique: uniqueIndex('blog-posts_id_unique').on(table.id)
};
}
);
export const testProducts = sqliteTable(
'test-products',
{
id: integer('id').primaryKey().notNull(),
name: text('name').notNull(),
strainType: text('strain_type').notNull(),
thcContent: text('thc_content').notNull(),
cbdContent: text('cbd_content').notNull(),
img: text('img').notNull(),
price: text('price').notNull(),
description: text('description').notNull(),
createdAt: integer('created_at')
.default(sql`(cast (unixepoch() as int))`)
.notNull(),
rating: integer('rating').default(0).notNull()
},
(table) => {
return {
idUnique: uniqueIndex('test-products_id_unique').on(table.id)
};
}
);
import { sqliteTable, text, numeric, uniqueIndex, integer } from 'drizzle-orm/sqlite-core';
import { sql } from 'drizzle-orm';
export const blogPosts = sqliteTable(
'blog-posts',
{
id: integer('id').primaryKey().notNull(),
name: text('name').notNull(),
headline: text('headline').notNull(),
body: text('body').notNull(),
createdAt: integer('created_at')
.default(sql`(cast (unixepoch() as int))`)
.notNull()
},
(table) => {
return {
idUnique: uniqueIndex('blog-posts_id_unique').on(table.id)
};
}
);
export const testProducts = sqliteTable(
'test-products',
{
id: integer('id').primaryKey().notNull(),
name: text('name').notNull(),
strainType: text('strain_type').notNull(),
thcContent: text('thc_content').notNull(),
cbdContent: text('cbd_content').notNull(),
img: text('img').notNull(),
price: text('price').notNull(),
description: text('description').notNull(),
createdAt: integer('created_at')
.default(sql`(cast (unixepoch() as int))`)
.notNull(),
rating: integer('rating').default(0).notNull()
},
(table) => {
return {
idUnique: uniqueIndex('test-products_id_unique').on(table.id)
};
}
);