Merge branch '1798-feature-gradidoid-1-adapt-and-migrate-database-schema' of github.com:gradido/gradido into 1798-feature-gradidoid-1-adapt-and-migrate-database-schema

This commit is contained in:
Claus-Peter Hübner 2022-07-19 02:53:22 +02:00
commit 7d0a0af68e
3 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ export class User extends BaseEntity {
@Column({
name: 'gradido_id',
length: 36,
nullable: true,
nullable: false,
default: null,
collation: 'utf8mb4_unicode_ci',
})

View File

@ -14,8 +14,8 @@ export class UserContact extends BaseEntity {
})
type: string
@Column({ name: 'users_id', type: 'int', unsigned: true, nullable: false })
usersId?: number | null
@Column({ name: 'user_id', type: 'int', unsigned: true, nullable: false })
userId: number
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
email: string

View File

@ -12,7 +12,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
CREATE TABLE IF NOT EXISTS \`user_contacts\` (
\`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
\`type\` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
\`users_id\` int(10) unsigned NOT NULL,
\`user_id\` int(10) unsigned NOT NULL,
\`email\` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL UNIQUE,
\`email_hash\` binary(32) NULL,
\`email_checked\` tinyint(4) NOT NULL DEFAULT 0,
@ -23,7 +23,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
PRIMARY KEY (\`id\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`)
await queryFn('ALTER TABLE `users` ADD COLUMN `gradido_id` varchar(36) NULL AFTER `id`;')
await queryFn('ALTER TABLE `users` ADD COLUMN `gradido_id` UUID NOT NULL DEFAULT UUID() AFTER `id`;')
await queryFn('ALTER TABLE `users` ADD COLUMN `alias` varchar(20) NULL AFTER `gradido_id`;')
await queryFn(
'ALTER TABLE `users` ADD COLUMN `passphrase_encrypt_type` varchar(36) NULL AFTER `privkey`;',