Boxer
Boxer
Explore posts from servers
DTDrizzle Team
Created by Boxer on 11/29/2023 in #help
Supabase/postgres get query is stuck on prod app
No description
25 replies
DTDrizzle Team
Created by Boxer on 8/14/2023 in #help
Default value for Array creates an incorrect SQL migration
I'm currently adding a new field roles to my PG table, users, such as:
export const users = pgTable(
'users',
{
user_id: text('user_id').primaryKey(),
balance: integer('balance').notNull().default(0),
roles: text('roles').array().default(['user']),
},
(table) => {
return {
user_idIdx: uniqueIndex('user_id_idx').on(table.user_id),
};
},
);
export const users = pgTable(
'users',
{
user_id: text('user_id').primaryKey(),
balance: integer('balance').notNull().default(0),
roles: text('roles').array().default(['user']),
},
(table) => {
return {
user_idIdx: uniqueIndex('user_id_idx').on(table.user_id),
};
},
);
The problem is that when I generate the SQL schema it returns this:
ALTER TABLE "users" ADD COLUMN "roles" text[] DEFAULT user;
ALTER TABLE "users" ADD COLUMN "roles" text[] DEFAULT user;
which is wrong since it thinks it's referencing to a user table but not just a default string value called user
1 replies
DTDrizzle Team
Created by Boxer on 7/16/2023 in #help
Module '"drizzle-orm/mysql-core"' has no exported member 'unique'.ts(2305)
Getting this error when trying to import unique
import {
text,
unique, // erroring out
mysqlTable,
serial,
mysqlEnum,
} from 'drizzle-orm/mysql-core';
import {
text,
unique, // erroring out
mysqlTable,
serial,
mysqlEnum,
} from 'drizzle-orm/mysql-core';
13 replies
DTDrizzle Team
Created by Boxer on 7/11/2023 in #help
mysql-core fails on TS build on 0.27.1
Getting this error when I try to build my ts node app
3 replies