这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion console/src/components/Services/Data/Add/AddActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const createTableSql = () => {
if (lCols.length === 0) return;
tableColumns = `${tableColumns}, FOREIGN KEY (${lCols.join(
', '
)}) REFERENCES "${refTableName}"(${rCols.join(
)}) REFERENCES "${currentSchema}"."${refTableName}"(${rCols.join(
', '
)}) ON UPDATE ${onUpdate} ON DELETE ${onDelete}`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ const ForeignKeySelector = ({
</div>
<select
value={refTableName || ''}
className={`${styles.select} form-control ${
styles.add_pad_left
}`}
className={`${styles.select} form-control ${styles.add_pad_left}`}
data-test={`foreign-key-ref-table-${index}`}
onChange={dispatchSetRefTable}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const pgConfTypes = {
a: 'no action',
r: 'restrict',
c: 'cascade',
n: 'null',
n: 'set null',
d: 'set default',
};

Expand Down
34 changes: 17 additions & 17 deletions console/src/components/Services/Data/TableModify/ModifyActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ const savePrimaryKeys = (tableName, schemaName, constraintName) => {
sql: `
alter table "${schemaName}"."${tableName}"
add constraint "${tableName}_pkey" primary key ( ${selectedPkColumns.join(
', '
)} );
', '
)} );
`,
},
});
Expand All @@ -183,8 +183,8 @@ const savePrimaryKeys = (tableName, schemaName, constraintName) => {
sql: `
alter table "${schemaName}"."${tableName}"
add constraint "${constraintName}" primary key ( ${tableSchema.primary_key.columns.join(
', '
)} );
', '
)} );
`,
});
}
Expand Down Expand Up @@ -270,7 +270,7 @@ const saveForeignKeys = (index, tableSchema, columns) => {
sql: `alter table "${schemaName}"."${tableName}" add constraint ${constraintName ||
generatedConstraintName} foreign key (${lcols.join(
', '
)}) references "${refTableName}"(${rcols.join(
)}) references "${schemaName}"."${refTableName}"(${rcols.join(
', '
)}) on update ${onUpdate} on delete ${onDelete};`,
},
Expand Down Expand Up @@ -1110,24 +1110,24 @@ const saveColumnChangesSql = (colName, column, allowRename) => {
const schemaChangesUp =
originalColType !== colType
? [
{
type: 'run_sql',
args: {
sql: columnChangesUpQuery,
{
type: 'run_sql',
args: {
sql: columnChangesUpQuery,
},
},
},
]
]
: [];
const schemaChangesDown =
originalColType !== colType
? [
{
type: 'run_sql',
args: {
sql: columnChangesDownQuery,
{
type: 'run_sql',
args: {
sql: columnChangesDownQuery,
},
},
},
]
]
: [];

/* column default up/down migration */
Expand Down