mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: extension, triggers, functions, comments, parameters management in sql-tools (#17269)
feat: sql-tools extension, triggers, functions, comments, parameters
This commit is contained in:
parent
51c2c60231
commit
e7a5b96ed0
170 changed files with 5205 additions and 2295 deletions
47
server/test/sql-tools/column-generated-identity.ts
Normal file
47
server/test/sql-tools/column-generated-identity.ts
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import { DatabaseConstraintType, DatabaseSchema, PrimaryGeneratedColumn, Table } from 'src/sql-tools';
|
||||
|
||||
@Table()
|
||||
export class Table1 {
|
||||
@PrimaryGeneratedColumn({ strategy: 'identity' })
|
||||
column1!: string;
|
||||
}
|
||||
|
||||
export const description = 'should register a table with a generated identity column';
|
||||
export const schema: DatabaseSchema = {
|
||||
name: 'postgres',
|
||||
schemaName: 'public',
|
||||
functions: [],
|
||||
enums: [],
|
||||
extensions: [],
|
||||
parameters: [],
|
||||
tables: [
|
||||
{
|
||||
name: 'table1',
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
tableName: 'table1',
|
||||
type: 'integer',
|
||||
identity: true,
|
||||
nullable: false,
|
||||
isArray: false,
|
||||
primary: true,
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
indexes: [],
|
||||
triggers: [],
|
||||
constraints: [
|
||||
{
|
||||
type: DatabaseConstraintType.PRIMARY_KEY,
|
||||
name: 'PK_50c4f9905061b1e506d38a2a380',
|
||||
tableName: 'table1',
|
||||
columnNames: ['column1'],
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
warnings: [],
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue