@sebspark/spanner-migrate 1.1.0 → 1.1.2

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.
@@ -106,7 +106,7 @@ var SQL_CREATE_TABLE_MIGRATIONS = `
106
106
  ) PRIMARY KEY (id)
107
107
  `;
108
108
  var ensureMigrationTable = async (db) => {
109
- const [rows] = await db.run(SQL_SELECT_TABLE_MIGRATIONS);
109
+ const [rows] = await db.run({ sql: SQL_SELECT_TABLE_MIGRATIONS, json: true });
110
110
  if (rows.length === 0) {
111
111
  console.log("Creating migration table");
112
112
  try {
@@ -126,7 +126,7 @@ var ensureMigrationTable = async (db) => {
126
126
  `Updating 'up' column of migration table to ${expectedType}`
127
127
  );
128
128
  await db.updateSchema(
129
- `ALTER TABLE migrations ALTER COLUMN up ${expectedType};`
129
+ `ALTER TABLE migrations ALTER COLUMN up ${expectedType}`
130
130
  );
131
131
  } catch (err) {
132
132
  console.error("Failed to update migrations table");
@@ -139,7 +139,7 @@ var ensureMigrationTable = async (db) => {
139
139
  `Updating 'down' column of migration table to ${expectedType}`
140
140
  );
141
141
  await db.updateSchema(
142
- `ALTER TABLE migrations ALTER COLUMN down ${expectedType};`
142
+ `ALTER TABLE migrations ALTER COLUMN down ${expectedType}`
143
143
  );
144
144
  } catch (err) {
145
145
  console.error("Failed to update migrations table");
package/dist/cli.js CHANGED
@@ -138,7 +138,7 @@ var SQL_CREATE_TABLE_MIGRATIONS = `
138
138
  ) PRIMARY KEY (id)
139
139
  `;
140
140
  var ensureMigrationTable = async (db) => {
141
- const [rows] = await db.run(SQL_SELECT_TABLE_MIGRATIONS);
141
+ const [rows] = await db.run({ sql: SQL_SELECT_TABLE_MIGRATIONS, json: true });
142
142
  if (rows.length === 0) {
143
143
  console.log("Creating migration table");
144
144
  try {
@@ -158,7 +158,7 @@ var ensureMigrationTable = async (db) => {
158
158
  `Updating 'up' column of migration table to ${expectedType}`
159
159
  );
160
160
  await db.updateSchema(
161
- `ALTER TABLE migrations ALTER COLUMN up ${expectedType};`
161
+ `ALTER TABLE migrations ALTER COLUMN up ${expectedType}`
162
162
  );
163
163
  } catch (err) {
164
164
  console.error("Failed to update migrations table");
@@ -171,7 +171,7 @@ var ensureMigrationTable = async (db) => {
171
171
  `Updating 'down' column of migration table to ${expectedType}`
172
172
  );
173
173
  await db.updateSchema(
174
- `ALTER TABLE migrations ALTER COLUMN down ${expectedType};`
174
+ `ALTER TABLE migrations ALTER COLUMN down ${expectedType}`
175
175
  );
176
176
  } catch (err) {
177
177
  console.error("Failed to update migrations table");
package/dist/cli.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  init,
6
6
  status,
7
7
  up
8
- } from "./chunk-FS26ULSB.mjs";
8
+ } from "./chunk-JLU5DVQC.mjs";
9
9
 
10
10
  // src/cli.ts
11
11
  import fs from "node:fs/promises";
package/dist/index.js CHANGED
@@ -134,7 +134,7 @@ var SQL_CREATE_TABLE_MIGRATIONS = `
134
134
  ) PRIMARY KEY (id)
135
135
  `;
136
136
  var ensureMigrationTable = async (db) => {
137
- const [rows] = await db.run(SQL_SELECT_TABLE_MIGRATIONS);
137
+ const [rows] = await db.run({ sql: SQL_SELECT_TABLE_MIGRATIONS, json: true });
138
138
  if (rows.length === 0) {
139
139
  console.log("Creating migration table");
140
140
  try {
@@ -154,7 +154,7 @@ var ensureMigrationTable = async (db) => {
154
154
  `Updating 'up' column of migration table to ${expectedType}`
155
155
  );
156
156
  await db.updateSchema(
157
- `ALTER TABLE migrations ALTER COLUMN up ${expectedType};`
157
+ `ALTER TABLE migrations ALTER COLUMN up ${expectedType}`
158
158
  );
159
159
  } catch (err) {
160
160
  console.error("Failed to update migrations table");
@@ -167,7 +167,7 @@ var ensureMigrationTable = async (db) => {
167
167
  `Updating 'down' column of migration table to ${expectedType}`
168
168
  );
169
169
  await db.updateSchema(
170
- `ALTER TABLE migrations ALTER COLUMN down ${expectedType};`
170
+ `ALTER TABLE migrations ALTER COLUMN down ${expectedType}`
171
171
  );
172
172
  } catch (err) {
173
173
  console.error("Failed to update migrations table");
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  init,
5
5
  status,
6
6
  up
7
- } from "./chunk-FS26ULSB.mjs";
7
+ } from "./chunk-JLU5DVQC.mjs";
8
8
  export {
9
9
  create,
10
10
  down,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebspark/spanner-migrate",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",