rado 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/define/Schema.js +4 -0
- package/package.json +1 -1
package/dist/define/Schema.js
CHANGED
|
@@ -22,6 +22,9 @@ var Schema;
|
|
|
22
22
|
}
|
|
23
23
|
function recreateTable(table, addedColumns) {
|
|
24
24
|
const queries = [];
|
|
25
|
+
queries.push(
|
|
26
|
+
Query.Raw({ strings: ["PRAGMA foreign_keys = OFF"], params: [] })
|
|
27
|
+
);
|
|
25
28
|
const tempTable = { ...table, name: `$$new_${table.name}` };
|
|
26
29
|
queries.push(Query.CreateTable({ table: tempTable }));
|
|
27
30
|
queries.push(
|
|
@@ -49,6 +52,7 @@ var Schema;
|
|
|
49
52
|
);
|
|
50
53
|
for (const index of Object.values(table.meta().indexes))
|
|
51
54
|
queries.push(Query.CreateIndex({ table, index }));
|
|
55
|
+
queries.push(Query.Raw({ strings: ["PRAGMA foreign_keys = ON"], params: [] }));
|
|
52
56
|
return queries;
|
|
53
57
|
}
|
|
54
58
|
function upgrade(formatter, local, schema) {
|