5 Commits
1.1.1 ... 1.1.2

Author SHA1 Message Date
William Oldham
1bb344ec2f Merge pull request #16 from movie-web/dev
v1.1.2: Fix Settings
2023-11-22 23:23:00 +00:00
William Oldham
b30623c483 Merge pull request #15 from movie-web/fix-user-settings
Fix user settings
2023-11-22 23:21:26 +00:00
William Oldham
233cb11ac6 Bump version 2023-11-22 23:17:29 +00:00
William Oldham
d3aa4847f8 Update UserSettings primary key to text, to match user 2023-11-22 23:17:29 +00:00
William Oldham
4bf2e658f7 Fix ESLint Ignore for migrations 2023-11-22 23:17:29 +00:00
5 changed files with 20 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ module.exports = {
sourceType: 'module', sourceType: 'module',
}, },
plugins: ['@typescript-eslint'], plugins: ['@typescript-eslint'],
ignorePatterns: ['./src/db/migrations/**/*'], ignorePatterns: ['src/db/migrations/**/*'],
rules: { rules: {
'@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-function-return-type': 'off',

View File

@@ -1,6 +1,6 @@
{ {
"name": "backend", "name": "backend",
"version": "1.1.1", "version": "1.1.2",
"private": true, "private": true,
"homepage": "https://github.com/movie-web/backend", "homepage": "https://github.com/movie-web/backend",
"engines": { "engines": {

View File

@@ -587,12 +587,12 @@
"columns": { "columns": {
"id": { "id": {
"name": "id", "name": "id",
"type": "uuid", "type": "text",
"unsigned": false, "unsigned": false,
"autoincrement": false, "autoincrement": false,
"primary": false, "primary": false,
"nullable": false, "nullable": false,
"mappedType": "uuid" "mappedType": "text"
}, },
"application_theme": { "application_theme": {
"name": "application_theme", "name": "application_theme",

View File

@@ -0,0 +1,14 @@
import { Migration } from '@mikro-orm/migrations';
export class Migration20231122231620 extends Migration {
async up(): Promise<void> {
this.addSql('alter table "user_settings" alter column "id" type text using ("id"::text);');
}
async down(): Promise<void> {
this.addSql('alter table "user_settings" alter column "id" drop default;');
this.addSql('alter table "user_settings" alter column "id" type uuid using ("id"::text::uuid);');
}
}

View File

@@ -1,10 +1,9 @@
import { Entity, PrimaryKey, Property } from '@mikro-orm/core'; import { Entity, PrimaryKey, Property } from '@mikro-orm/core';
import { randomUUID } from 'crypto';
@Entity({ tableName: 'user_settings' }) @Entity({ tableName: 'user_settings' })
export class UserSettings { export class UserSettings {
@PrimaryKey({ name: 'id', type: 'uuid' }) @PrimaryKey({ name: 'id', type: 'text' })
id: string = randomUUID(); id!: string;
@Property({ name: 'application_theme', nullable: true }) @Property({ name: 'application_theme', nullable: true })
applicationTheme?: string | null; applicationTheme?: string | null;