philbookst
philbookst
Explore posts from servers
DTDrizzle Team
Created by philbookst on 5/11/2023 in #help
DatabaseError: Duplicate column name 'id'
i'm sorry i don't quite remeber, it was almost a year ago i do remeber printing out the raw sql and asking chatgpt whats wrong πŸ˜„
5 replies
DTDrizzle Team
Created by philbookst on 12/20/2023 in #help
push:sqlite error _old_push table with turso
yes i think i also had this error sometimes
6 replies
DTDrizzle Team
Created by philbookst on 12/20/2023 in #help
push:sqlite error _old_push table with turso
I don’t think so πŸ˜΅β€πŸ’«
6 replies
DTDrizzle Team
Created by thdxr on 7/12/2023 in #help
0.27.2 mysql:push
it deleted the dummy constraint when trying db:push
26 replies
DTDrizzle Team
Created by thdxr on 7/12/2023 in #help
0.27.2 mysql:push
I think you can use any schema with uniqueIndex added Here is my schema for the failing table as reference though:
export const Account = mysqlTable(
"Account",
{
id: varchar("id", { length: 50 }).primaryKey().notNull(),
tenantId: varchar("tenantId", { length: 100 }).notNull(),
createdAt: timestamp("createdAt").defaultNow(),
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow(),
role: mysqlEnum("role", ["ADMIN", "USER"]).default("USER").notNull(),
email: varchar("email", { length: 100 }).notNull(),
emailVerified: timestamp("emailVerified"),
passwordHash: varchar("passwordHash", { length: 150 }).notNull(),
userAuthToken: varchar("userAuthToken", { length: 50 }).notNull(),
passwordResetToken: varchar("passwordResetToken", { length: 50 }),
passwordResetExpiry: timestamp("passwordResetExpiry"),
userId: varchar("userId", { length: 50 }).notNull()
},
(table) => {
return {
userIdKey: uniqueIndex("Account_userId_key").on(table.userId),
passwordResetTokenKey: uniqueIndex("Account_passwordResetToken_key").on(
table.passwordResetToken
),
tenantIduserAuthTokenIdx: uniqueIndex("Account_tenantId_userAuthToken_idx").on(
table.userAuthToken,
table.tenantId
),
tenantIdUserEmailIdx: uniqueIndex("Account_tenantId_userEmail_idx").on(
table.tenantId,
table.email
)
};
}
);
export const Account = mysqlTable(
"Account",
{
id: varchar("id", { length: 50 }).primaryKey().notNull(),
tenantId: varchar("tenantId", { length: 100 }).notNull(),
createdAt: timestamp("createdAt").defaultNow(),
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow(),
role: mysqlEnum("role", ["ADMIN", "USER"]).default("USER").notNull(),
email: varchar("email", { length: 100 }).notNull(),
emailVerified: timestamp("emailVerified"),
passwordHash: varchar("passwordHash", { length: 150 }).notNull(),
userAuthToken: varchar("userAuthToken", { length: 50 }).notNull(),
passwordResetToken: varchar("passwordResetToken", { length: 50 }),
passwordResetExpiry: timestamp("passwordResetExpiry"),
userId: varchar("userId", { length: 50 }).notNull()
},
(table) => {
return {
userIdKey: uniqueIndex("Account_userId_key").on(table.userId),
passwordResetTokenKey: uniqueIndex("Account_passwordResetToken_key").on(
table.passwordResetToken
),
tenantIduserAuthTokenIdx: uniqueIndex("Account_tenantId_userAuthToken_idx").on(
table.userAuthToken,
table.tenantId
),
tenantIdUserEmailIdx: uniqueIndex("Account_tenantId_userEmail_idx").on(
table.tenantId,
table.email
)
};
}
);
i've played with adding a dummy constraint ALTER TABLE Account ADD CONSTRAINT Account_userId_key CHECK (LENGTH(id) > 0); which fixed the error for Account_userId_key but then a new error for Account_passwordResetToken_key popped up
26 replies
DTDrizzle Team
Created by thdxr on 7/12/2023 in #help
0.27.2 mysql:push
i got the same problem, did you find a fix for it or do we need to wait for a new version?
26 replies
CDCloudflare Developers
Created by philbookst on 6/26/2023 in #pages-help
Issue re-adding deleted custom domain
skalierbar.co, but i've tried 2 other domains as well and got the same result it doesn't show in the custom domains panel of my pages project but it still works for some reason
3 replies
DTDrizzle Team
Created by philbookst on 5/11/2023 in #help
uuid missing in drizzle-orm/mysql-core?
i use varchar("id", { length: 191 }).primaryKey().notNull() for most tables and then just generate the id via crypto.randomUUID() on the server side for my insert statements
12 replies
DTDrizzle Team
Created by philbookst on 5/30/2023 in #help
Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020
fixed in v0.26.3!
2 replies
CDCloudflare Developers
Created by philbookst on 5/18/2023 in #pages-help
Error 522 when trying to setup a vanity domain via cf for saas
oh that worked! thank you very much! i was even able to use a subdomain of my pages project (app.example.com) as a cname value to make it look nice
11 replies
CDCloudflare Developers
Created by philbookst on 5/18/2023 in #pages-help
Error 522 when trying to setup a vanity domain via cf for saas
11 replies
CDCloudflare Developers
Created by philbookst on 5/18/2023 in #pages-help
Error 522 when trying to setup a vanity domain via cf for saas
ok but what do I need to do?
11 replies
CDCloudflare Developers
Created by philbookst on 5/18/2023 in #pages-help
Error 522 when trying to setup a vanity domain via cf for saas
but then it prompts me to add the domain to cloudflare dns, but i dont own the domain i'm building a saas product where a customer can use his own custom domain instead of a subdomain of my pages domain
11 replies
CDCloudflare Developers
Created by philbookst on 5/17/2023 in #general-help
CF for saas hostname _acme-challenge not validating
ok if i add the _acme-challenge record without my domain at the end the verification is successful - but it's weird for the _cf-custom-hostname record if the domain is suffixed it still works out just fine
2 replies