mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
add Project Branding Table
This commit is contained in:
parent
6af4db7041
commit
5adc84bc84
@ -0,0 +1,25 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
|
||||
|
||||
@Entity('project_brandings')
|
||||
export class ProjectBranding {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ name: 'name', type: 'varchar', length: 255 })
|
||||
name: string
|
||||
|
||||
@Column({ name: 'alias', type: 'varchar', length: 32 })
|
||||
alias: string
|
||||
|
||||
@Column({ name: 'description', type: 'text', nullable: true, default: null })
|
||||
description: string | null
|
||||
|
||||
@Column({ name: 'space_id', type: 'int', unsigned: true, nullable: true, default: null })
|
||||
spaceId: number | null
|
||||
|
||||
@Column({ name:'new_user_to_space', type: 'tinyint', width: 1, default: 0 })
|
||||
newUserToSpace: boolean
|
||||
|
||||
@Column({ name: 'logo_url', type: 'varchar', length: 255, nullable: true, default: null })
|
||||
logoUrl: string | null
|
||||
}
|
||||
1
database/entity/ProjectBranding.ts
Normal file
1
database/entity/ProjectBranding.ts
Normal file
@ -0,0 +1 @@
|
||||
export { ProjectBranding } from './0088-create_project_brandings/ProjectBranding'
|
||||
@ -2,6 +2,7 @@ import { ContributionLink } from './ContributionLink'
|
||||
import { LoginElopageBuys } from './LoginElopageBuys'
|
||||
import { LoginEmailOptIn } from './LoginEmailOptIn'
|
||||
import { Migration } from './Migration'
|
||||
import { ProjectBranding } from './ProjectBranding'
|
||||
import { Transaction } from './Transaction'
|
||||
import { TransactionLink } from './TransactionLink'
|
||||
import { User } from './User'
|
||||
@ -26,6 +27,7 @@ export const entities = [
|
||||
LoginElopageBuys,
|
||||
LoginEmailOptIn,
|
||||
Migration,
|
||||
ProjectBranding,
|
||||
PendingTransaction,
|
||||
Transaction,
|
||||
TransactionLink,
|
||||
|
||||
25
database/migrations/0088-create_project_brandings.ts
Normal file
25
database/migrations/0088-create_project_brandings.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/* MIGRATION TO CREATE THE project_brandings table
|
||||
*
|
||||
* This migration creates the `community` and 'communityfederation' tables in the `apollo` database (`gradido_community`).
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(`
|
||||
CREATE TABLE \`project_brandings\`(
|
||||
\`id\` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
\`name\` VARCHAR(255) NOT NULL,
|
||||
\`alias\` VARCHAR(32) NOT NULL,
|
||||
\`description\` TEXT NULL DEFAULT NULL,
|
||||
\`space_id\` INT UNSIGNED NULL DEFAULT NULL,
|
||||
\`new_user_to_space\` TINYINT(1) NOT NULL DEFAULT FALSE,
|
||||
\`logo_url\` VARCHAR(255) NULL DEFAULT NULL,
|
||||
PRIMARY KEY(\`id\`)
|
||||
) ENGINE = InnoDB;
|
||||
`)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('DROP TABLE `project_brandings`')
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user