mirror of
https://github.com/immich-app/immich.git
synced 2025-11-17 00:32:37 +09:00
feat: schema diff sql tools (#17116)
This commit is contained in:
35
server/test/sql-tools/column-default-date.stub.ts
Normal file
35
server/test/sql-tools/column-default-date.stub.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Column, DatabaseSchema, Table } from 'src/sql-tools';
|
||||
|
||||
const date = new Date(2023, 0, 1);
|
||||
|
||||
@Table()
|
||||
export class Table1 {
|
||||
@Column({ type: 'character varying', default: date })
|
||||
column1!: string;
|
||||
}
|
||||
|
||||
export const description = 'should register a table with a column with a default value (date)';
|
||||
export const schema: DatabaseSchema = {
|
||||
name: 'public',
|
||||
tables: [
|
||||
{
|
||||
name: 'table1',
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
tableName: 'table1',
|
||||
type: 'character varying',
|
||||
nullable: false,
|
||||
isArray: false,
|
||||
primary: false,
|
||||
synchronize: true,
|
||||
default: "'2023-01-01T00:00:00.000Z'",
|
||||
},
|
||||
],
|
||||
indexes: [],
|
||||
constraints: [],
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
warnings: [],
|
||||
};
|
||||
Reference in New Issue
Block a user