mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 09:13:14 +03:00
feat: naming strategy (#19848)
* feat: naming strategy * feat: detect renames
This commit is contained in:
@@ -28,6 +28,7 @@ const fromColumn = (column: Partial<Omit<DatabaseColumn, 'tableName'>>): Databas
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
primary: false,
|
||||
synchronize: true,
|
||||
isArray: false,
|
||||
type: 'character varying',
|
||||
@@ -63,6 +64,7 @@ const fromConstraint = (constraint?: DatabaseConstraint): DatabaseSchema => {
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
primary: false,
|
||||
synchronize: true,
|
||||
isArray: false,
|
||||
type: 'character varying',
|
||||
@@ -97,6 +99,7 @@ const fromIndex = (index?: DatabaseIndex): DatabaseSchema => {
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
primary: false,
|
||||
synchronize: true,
|
||||
isArray: false,
|
||||
type: 'character varying',
|
||||
@@ -140,6 +143,7 @@ const newSchema = (schema: {
|
||||
columns.push({
|
||||
tableName,
|
||||
name: columnName,
|
||||
primary: false,
|
||||
type: column.type || 'character varying',
|
||||
isArray: column.isArray ?? false,
|
||||
nullable: column.nullable ?? false,
|
||||
@@ -182,6 +186,7 @@ describe(schemaDiff.name, () => {
|
||||
const column: DatabaseColumn = {
|
||||
type: 'character varying',
|
||||
tableName: 'table1',
|
||||
primary: false,
|
||||
name: 'column1',
|
||||
isArray: false,
|
||||
nullable: false,
|
||||
@@ -264,6 +269,7 @@ describe(schemaDiff.name, () => {
|
||||
column: {
|
||||
tableName: 'table1',
|
||||
isArray: false,
|
||||
primary: false,
|
||||
name: 'column2',
|
||||
nullable: false,
|
||||
type: 'character varying',
|
||||
|
||||
Reference in New Issue
Block a user