Trustody
Trustody
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
I was asked to push the app as a package to GitHub, so I had to dockerize it. Now, I want to set up tests in the CI/CD pipeline, and using containers that start up and shut down on their own seems like the best way to go, right?
20 replies
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
i'm using docker for both, i'll try to figure it ou
20 replies
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
Hello @Angelelz, I'm trying to use Docker for my test database but I don't know why my migrations won't be made
backend_test_app | No config path provided, using default 'drizzle.config.ts'
backend_test_app | Reading config file '/usr/src/app/drizzle.config.ts'
backend_test_app | 0 tables
backend_test_app |
backend_test_app |
backend_test_app | No schema changes, nothing to migrate 😴
backend_test_app | $ bun drizzle-kit migrate
backend_test_app | [bun] Warning: async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.
backend_test_app | drizzle-kit: v0.22.8
backend_test_app | drizzle-orm: v0.31.4
backend_test_app |
backend_test_app | No config path provided, using default path
backend_test_app | Reading config file '/usr/src/app/drizzle.config.ts'
backend_test_app | No config path provided, using default 'drizzle.config.ts'
backend_test_app | Reading config file '/usr/src/app/drizzle.config.ts'
backend_test_app | 0 tables
backend_test_app |
backend_test_app |
backend_test_app | No schema changes, nothing to migrate 😴
backend_test_app | $ bun drizzle-kit migrate
backend_test_app | [bun] Warning: async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.
backend_test_app | drizzle-kit: v0.22.8
backend_test_app | drizzle-orm: v0.31.4
backend_test_app |
backend_test_app | No config path provided, using default path
backend_test_app | Reading config file '/usr/src/app/drizzle.config.ts'
I'm getting this, as if my files were empty but i can cat them and they seem intact Do you have any documentation or idea of my mistake ?
20 replies
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
this looks promising
20 replies
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
I'm really not a docker expert, gotta learn it first
20 replies
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
I agree with you, best would be to completely separate the different environments, but I only have one database at disposal. They asked me to use 3 differents pgSchemas for test, dev and prod I've seen this but this would lead to have everything in one pgSchema with just prefixes on each table name
20 replies
DTDrizzle Team
Created by maverickdoge on 8/27/2024 in #help
Only return single result
seems pretty easy to me
5 replies
DTDrizzle Team
Created by maverickdoge on 8/27/2024 in #help
Only return single result
just select first element with [0]
5 replies
DTDrizzle Team
Created by flafff on 8/27/2024 in #help
User Settings architecture
Just throw in a third table to link users and their chosen modules. Something like this:
export const preferences = pgTable('preferences', {
userId: integer('user_id').references(() => user.id).notNull(),
moduleId: integer('module_id').references(() => module.id).notNull(),
createdAt: timestamp('created_at').defaultNow(),
}, (table) => ({
primaryKey: ['userId', 'moduleId'],
}))
export const preferences = pgTable('preferences', {
userId: integer('user_id').references(() => user.id).notNull(),
moduleId: integer('module_id').references(() => module.id).notNull(),
createdAt: timestamp('created_at').defaultNow(),
}, (table) => ({
primaryKey: ['userId', 'moduleId'],
}))
This way, users can pick multiple modules without any hassle. The combo of userId and moduleId keeps them from selecting the same one twice, and it all stays nice and clean in the database.
2 replies
DTDrizzle Team
Created by Trustody on 8/26/2024 in #help
Prod database and Test database in Drizzle
any feedback, please ? 🥺
20 replies