@ad-sdk/bgd 0.0.6 → 0.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ad-sdk/bgd",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "index.js",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": {
@@ -62,9 +62,9 @@ async function migrate(driver, directory, options) {
62
62
  query: fc.trim()
63
63
  }, {
64
64
  query: `INSERT INTO bgd_migrations (
65
- migration_id, filename, sort_index
66
- ) VALUES ($1::TEXT, $2::TEXT, $3::INT)`,
67
- values: [(0, _uidlib.uuidv7)(), contentsList[0].name, parseInt(contentsList[i].name.split("_")[0], 10)]
65
+ migration_id, filename, order
66
+ ) VALUES ($1::TEXT, $2::TEXT, $3::VARCHAR)`,
67
+ values: [(0, _uidlib.uuidv7)(), contentsList[0].name, contentsList[i].name.split("_")[0]]
68
68
  }]);
69
69
  for (let j = 0; j < res.length; ++j) {
70
70
  if (res[j].isLeft()) {
@@ -84,11 +84,11 @@ async function migrate(driver, directory, options) {
84
84
  return (0, _either.left)(e);
85
85
  }
86
86
  }
87
- const PGCT_QUERY = `CREATE TABLE IF NOT EXISTS ad_bgd_migrations (
87
+ const PGCT_QUERY = `CREATE TABLE IF NOT EXISTS bgd_migrations (
88
88
  migration_id VARCHAR(100) NOT NULL UNIQUE PRIMARY KEY,
89
89
  sequence SERIAL NOT NULL,
90
90
  filename VARCHAR(255) NOT NULL UNIQUE,
91
- sort_index INT NOT NULL,
91
+ order VARCHAR(4) NOT NULL,
92
92
  executed_at TIMESTAMP WITH TIME ZONE NOT NULL
93
93
  DEFAULT (NOW() AT TIME ZONE 'UTC')
94
94
  )`;
@@ -107,7 +107,7 @@ async function ensureTable_(driver) {
107
107
  }
108
108
  async function listExecuted_(driver) {
109
109
  await ensureTable_(driver);
110
- const res = await driver.exec("SELECT * FROM migrations");
110
+ const res = await driver.exec("SELECT * FROM bgd_migrations");
111
111
  if (res.isLeft()) {
112
112
  throw res.value;
113
113
  }