@nina-protocol/nina-db 0.0.73 → 0.0.75

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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @param { import("knex").Knex } knex
3
+ * @returns { Promise<void> }
4
+ */
5
+ export const up = function (knex) {
6
+ return knex.schema.table('releases', table => {
7
+ table.renameColumn('hidden', 'archived');
8
+ });
9
+ };
10
+ /**
11
+ * @param { import("knex").Knex } knex
12
+ * @returns { Promise<void> }
13
+ */
14
+ export const down = function (knex) {
15
+ return knex.schema.table('releases', table => {
16
+ table.renameColumn('archived', 'hidden');
17
+ });
18
+ };
@@ -42,6 +42,7 @@ export default class Release extends Model {
42
42
  }
43
43
  },
44
44
  price: { type: 'string' },
45
+ archived: { type: 'boolean' },
45
46
  },
46
47
  };
47
48
  static findOrCreate = async (publicKey, hubPublicKey = null) => {
@@ -95,6 +96,7 @@ export default class Release extends Model {
95
96
  publisherId,
96
97
  price: `${price}`,
97
98
  paymentMint,
99
+ archived: false
98
100
  });
99
101
  if (metadata.properties.tags) {
100
102
  for await (let tag of metadata.properties.tags) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nina-protocol/nina-db",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @param { import("knex").Knex } knex
3
+ * @returns { Promise<void> }
4
+ */
5
+ export const up = function(knex) {
6
+ return knex.schema.table('releases' , table => {
7
+ table.boolean('hidden').notNullable().defaultTo(false);
8
+ });
9
+ };
10
+
11
+ /**
12
+ * @param { import("knex").Knex } knex
13
+ * @returns { Promise<void> }
14
+ */
15
+ export const down = function(knex) {
16
+
17
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @param { import("knex").Knex } knex
3
+ * @returns { Promise<void> }
4
+ */
5
+ export const up = function(knex) {
6
+ return knex.schema.table('releases' , table => {
7
+ table.renameColumn('hidden', 'archived');
8
+ });
9
+ };
10
+
11
+ /**
12
+ * @param { import("knex").Knex } knex
13
+ * @returns { Promise<void> }
14
+ */
15
+ export const down = function(knex) {
16
+ return knex.schema.table('releases' , table => {
17
+ table.renameColumn('archived', 'hidden');
18
+ });
19
+ };
@@ -44,6 +44,7 @@ export default class Release extends Model {
44
44
  }
45
45
  },
46
46
  price: { type: 'string' },
47
+ archived: { type: 'boolean' },
47
48
  },
48
49
  }
49
50
 
@@ -106,6 +107,7 @@ export default class Release extends Model {
106
107
  publisherId,
107
108
  price: `${price}`,
108
109
  paymentMint,
110
+ archived: false
109
111
  })
110
112
  if (metadata.properties.tags) {
111
113
  for await (let tag of metadata.properties.tags) {