mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 17:13:58 +00:00
add column WIP
This commit is contained in:
@@ -531,7 +531,9 @@ export class SqlDumper implements AlterProcessor {
|
|||||||
renameConstraint(constraint: ConstraintInfo, newName: string) {}
|
renameConstraint(constraint: ConstraintInfo, newName: string) {}
|
||||||
|
|
||||||
createColumn(column: ColumnInfo, constraints: ConstraintInfo[]) {
|
createColumn(column: ColumnInfo, constraints: ConstraintInfo[]) {
|
||||||
this.put('^alter ^table %f ^add %i ', column, column.columnName);
|
this.put('^alter ^table %f ^add ', column);
|
||||||
|
if (this.dialect.createColumnWithColumnKeyword) this.put('^column ');
|
||||||
|
this.put(' %i ', column.columnName);
|
||||||
this.columnDefinition(column);
|
this.columnDefinition(column);
|
||||||
this.inlineConstraints(constraints);
|
this.inlineConstraints(constraints);
|
||||||
this.endCommand();
|
this.endCommand();
|
||||||
|
|||||||
3
packages/types/dialect.d.ts
vendored
3
packages/types/dialect.d.ts
vendored
@@ -34,6 +34,9 @@ export interface SqlDialect {
|
|||||||
createCheck?: boolean;
|
createCheck?: boolean;
|
||||||
dropCheck?: boolean;
|
dropCheck?: boolean;
|
||||||
|
|
||||||
|
// syntax for create column: ALTER TABLE table ADD COLUMN column
|
||||||
|
createColumnWithColumnKeyword?: boolean;
|
||||||
|
|
||||||
dropReferencesWhenDropTable?: boolean;
|
dropReferencesWhenDropTable?: boolean;
|
||||||
requireFromDual?: boolean;
|
requireFromDual?: boolean;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ const dialect = {
|
|||||||
changeColumn: true,
|
changeColumn: true,
|
||||||
createIndex: true,
|
createIndex: true,
|
||||||
dropIndex: true,
|
dropIndex: true,
|
||||||
|
anonymousPrimaryKey: true,
|
||||||
|
createColumnWithColumnKeyword: true,
|
||||||
|
|
||||||
columnProperties: {
|
columnProperties: {
|
||||||
columnComment: true,
|
columnComment: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user