Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Db translations #105

Merged
merged 17 commits into from
Oct 26, 2023
Merged
4 changes: 0 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ DATABASE_LABEL=stage
DATABASE_USERNAME=toBeChanged
DATABASE_PASSWORD=toBeChanged

# Local DB
# DATABASE_LABEL=local
# USE_LOCAL_DB=true

# AWS S3 connection settings
AWS_ACCESS_KEY_ID=toBeChanged
AWS_SECRET_ACCESS_KEY=toBeChanged
7 changes: 7 additions & 0 deletions drizzle/0004_curvy_colleen_wing.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE `place_translation` (
`id` serial AUTO_INCREMENT NOT NULL,
`place_id` int NOT NULL,
`locale` varchar(10) NOT NULL,
`name` text NOT NULL,
CONSTRAINT `place_translation_id` PRIMARY KEY(`id`)
);
329 changes: 329 additions & 0 deletions drizzle/meta/0004_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,329 @@
{
"version": "5",
"dialect": "mysql",
"id": "5ab66feb-1129-4822-99c3-4e3bb4ac5de2",
"prevId": "aea0cf0a-32d1-453e-b0e7-2419b3070b31",
"tables": {
"place": {
"name": "place",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": false,
"notNull": true,
"autoincrement": true
},
"mainImage": {
"name": "mainImage",
"type": "varchar(1024)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"place_id": {
"name": "place_id",
"columns": [
"id"
]
}
},
"uniqueConstraints": {}
},
"place_translation": {
"name": "place_translation",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": false,
"notNull": true,
"autoincrement": true
},
"place_id": {
"name": "place_id",
"type": "int",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"locale": {
"name": "locale",
"type": "varchar(10)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"place_translation_id": {
"name": "place_translation_id",
"columns": [
"id"
]
}
},
"uniqueConstraints": {}
},
"account": {
"name": "account",
"columns": {
"userId": {
"name": "userId",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"providerAccountId": {
"name": "providerAccountId",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"expires_at": {
"name": "expires_at",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"token_type": {
"name": "token_type",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"scope": {
"name": "scope",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"id_token": {
"name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"session_state": {
"name": "session_state",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"account_provider_providerAccountId": {
"name": "account_provider_providerAccountId",
"columns": [
"provider",
"providerAccountId"
]
}
},
"uniqueConstraints": {}
},
"session": {
"name": "session",
"columns": {
"sessionToken": {
"name": "sessionToken",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"userId": {
"name": "userId",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires": {
"name": "expires",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"session_sessionToken": {
"name": "session_sessionToken",
"columns": [
"sessionToken"
]
}
},
"uniqueConstraints": {}
},
"user": {
"name": "user",
"columns": {
"id": {
"name": "id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"hashedPassword": {
"name": "hashedPassword",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"email": {
"name": "email",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"emailVerified": {
"name": "emailVerified",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"image": {
"name": "image",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"user_id": {
"name": "user_id",
"columns": [
"id"
]
}
},
"uniqueConstraints": {
"user_email_unique": {
"name": "user_email_unique",
"columns": [
"email"
]
}
}
},
"verificationToken": {
"name": "verificationToken",
"columns": {
"identifier": {
"name": "identifier",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"token": {
"name": "token",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires": {
"name": "expires",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"verificationToken_identifier_token": {
"name": "verificationToken_identifier_token",
"columns": [
"identifier",
"token"
]
}
},
"uniqueConstraints": {}
}
},
"schemas": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"when": 1698187240633,
"tag": "0003_colorful_fat_cobra",
"breakpoints": true
},
{
"idx": 4,
"version": "5",
"when": 1698286606173,
"tag": "0004_curvy_colleen_wing",
"breakpoints": true
}
]
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"test:e2e:dev": "playwright test --ui",
"db:generate": "SKIP_ENV_VALIDATION=true drizzle-kit generate:mysql",
"db:push": "drizzle-kit push:mysql",
"db-local:studio": "drizzle-kit studio",
"db-local:migrate": "node ./src/server/db/migrate.mjs",
"db-local:run-app": "USE_LOCAL_DB=true next dev",
"db-local:run-db": "docker run --name descobreix-begur-app-database -e MYSQL_ROOT_PASSWORD=unsafePaswordOnlyForLocalhost -e MYSQL_DATABASE=descobreix-begur-app -p 3306:3306 mysql"
"db:studio": "drizzle-kit studio",
"db:local:studio": "USE_LOCAL_DB=true drizzle-kit studio",
"db:local:migrate": "USE_LOCAL_DB=true node ./src/server/db/migrate.mjs",
"db:local:run-app": "USE_LOCAL_DB=true DATABASE_LABEL=local next dev",
"db:local:run-db": "docker run --name descobreix-begur-app-database -e MYSQL_ROOT_PASSWORD=unsafePaswordOnlyForLocalhost -e MYSQL_DATABASE=descobreix-begur-app -p 3306:3306 mysql"
},
"dependencies": {
"@auth/core": "0.12.0",
Expand Down
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
// webServer: [
// {
// command: 'pnpm db-local:run-app',
// command: 'pnpm db:local:run-app',
// url: 'http://localhost:3000',
// reuseExistingServer: !process.env.CI,
// },
// {
// command: 'pnpm db-local:run-db',
// command: 'pnpm db:local:run-db',
// url: 'http://localhost:3306',
// reuseExistingServer: !process.env.CI,
// },
Expand Down
Loading
Loading