Jannik
Jannik
Explore posts from servers
CDCloudflare Developers
Created by Jannik on 10/14/2024 in #general-help
R2 Public bucket and private files
Hey, can i use one bucket where a part of it is public and another one private? or should i use 2 buckets, one private and one public?
2 replies
CDCloudflare Developers
Created by Jannik on 9/16/2024 in #general-help
R2 is stuck in Plan selection
I wrote the support and i havent a reply in over a week. How is that possible?
10 replies
CDCloudflare Developers
Created by Jannik on 9/12/2024 in #general-help
Stuck at R2 Plans page
Hey, when i click add r2 plan to my account i get redirected to the same page over and over again
1 replies
DTDrizzle Team
Created by Jannik on 6/17/2024 in #help
Unable to run migration pgenum
import { pgTable, serial, text, varchar, pgEnum, numeric } from 'drizzle-orm/pg-core';

const roleEnum = pgEnum('role', ['admin', 'user']);
export const users = pgTable('users', {
id: serial('id').primaryKey(),
firstName: varchar('first_name').notNull(),
lastName: varchar('last_name').notNull(),
email: text('email').notNull(),
password: text('password').notNull(),
role: roleEnum('role').notNull()
});
import { pgTable, serial, text, varchar, pgEnum, numeric } from 'drizzle-orm/pg-core';

const roleEnum = pgEnum('role', ['admin', 'user']);
export const users = pgTable('users', {
id: serial('id').primaryKey(),
firstName: varchar('first_name').notNull(),
lastName: varchar('last_name').notNull(),
email: text('email').notNull(),
password: text('password').notNull(),
role: roleEnum('role').notNull()
});
i added a new enum but when i run migrate im getting an error and the migration did not get applied:
Using 'pg' driver for database querying
[⣷] applying migrations...error: type "role" does not exist
at /Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/drizzle-kit/bin.cjs:77696:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at <anonymous> (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/pg-core/dialect.ts:89:7)
at NodePgSession.transaction (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/node-postgres/session.ts:155:19)
at PgDialect.migrate (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/pg-core/dialect.ts:82:3)
at migrate (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/node-postgres/migrator.ts:10:2) {
length: 91,
Using 'pg' driver for database querying
[⣷] applying migrations...error: type "role" does not exist
at /Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/drizzle-kit/bin.cjs:77696:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at <anonymous> (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/pg-core/dialect.ts:89:7)
at NodePgSession.transaction (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/node-postgres/session.ts:155:19)
at PgDialect.migrate (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/pg-core/dialect.ts:82:3)
at migrate (/Users/jannikkoster/Documents/e-commerce/svelte-commerce/node_modules/src/node-postgres/migrator.ts:10:2) {
length: 91,
1 replies
PPrisma
Created by Jannik on 5/15/2024 in #help-and-questions
Prisma is not using test env file
"test": "cross-env NODE_ENV=test && dotenv -e .env.test -- npx prisma db push && vitest"
"test": "cross-env NODE_ENV=test && dotenv -e .env.test -- npx prisma db push && vitest"
it is creating the following db
DATABASE_URL="./dev.db"
DATABASE_URL="./dev.db"
but it should
DATABASE_URL="./test.db"
DATABASE_URL="./test.db"
2 replies