Skip to content

Commit

Permalink
Merge pull request #17 from futura-dev/fix/sequelize-dialect
Browse files Browse the repository at this point in the history
fix: specify dialect in sequelize initialization
  • Loading branch information
faridevnz authored Nov 5, 2024
2 parents 64de2c1 + 35d7371 commit 79183e1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/cmd/db/seed/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ const chooseTenantPrompt = async (): Promise<string[]> => {
const configFilePath = path.join(".cosmoprism.json");
const config = JSON.parse(await fs.readFile(configFilePath, "utf-8"));

const sequelize = new Sequelize(config.centralDatabaseUrl);
const sequelize = new Sequelize(config.centralDatabaseUrl, {
dialect: "postgres"
});
const queryExecution = await sequelize.query(
`SELECT * FROM "${config.tenantTable.name}";`,
{ logging: false }
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/migrate/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const chooseTenantPrompt = async (): Promise<string[]> => {
const configFilePath = path.join(".cosmoprism.json");
const config = JSON.parse(await fs.readFile(configFilePath, "utf-8"));

const sequelize = new Sequelize(config.centralDatabaseUrl);
const sequelize = new Sequelize(config.centralDatabaseUrl, {
dialect: "postgres"
});
const queryExecution = await sequelize.query(
`SELECT * FROM "${config.tenantTable.name}";`,
{ logging: false }
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/migrate/dev/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ const chooseTenantPrompt = async (): Promise<string[]> => {
const configFilePath = path.join(".cosmoprism.json");
const config = JSON.parse(await fs.readFile(configFilePath, "utf-8"));

const sequelize = new Sequelize(config.centralDatabaseUrl);
const sequelize = new Sequelize(config.centralDatabaseUrl, {
dialect: "postgres"
});
const queryExecution = await sequelize.query(
`SELECT * FROM "${config.tenantTable.name}";`,
{ logging: false }
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/migrate/reset/reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ const chooseTenantPrompt = async (): Promise<string[]> => {
const configFilePath = path.join(".cosmoprism.json");
const config = JSON.parse(await fs.readFile(configFilePath, "utf-8"));

const sequelize = new Sequelize(config.centralDatabaseUrl);
const sequelize = new Sequelize(config.centralDatabaseUrl, {
dialect: "postgres"
});
const queryExecution = await sequelize.query(
`SELECT * FROM "${config.tenantTable.name}";`,
{ logging: false }
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/studio/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ const chooseTenantPrompt = async (): Promise<string> => {
const configFilePath = path.join(".cosmoprism.json");
const config = JSON.parse(await fs.readFile(configFilePath, "utf-8"));

const sequelize = new Sequelize(config.centralDatabaseUrl);
const sequelize = new Sequelize(config.centralDatabaseUrl, {
dialect: "postgres"
});
const queryExecution = await sequelize.query(
`SELECT * FROM "${config.tenantTable.name}";`,
{ logging: false }
Expand Down

0 comments on commit 79183e1

Please sign in to comment.