@nina-protocol/nina-db 0.0.73 → 0.0.74
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/migrations/20240821155034_release_hidden_to_archived.js +18 -0
- package/dist/models/Release.js +2 -1
- package/package.json +1 -1
- package/src/migrations/20240321155034_hide_release.js +17 -0
- package/src/migrations/20240821155034_release_hidden_to_archived.js +19 -0
- package/src/models/Release.js +2 -1
|
@@ -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
|
+
};
|
package/dist/models/Release.js
CHANGED
|
@@ -16,7 +16,7 @@ export default class Release extends Model {
|
|
|
16
16
|
static idColumn = 'id';
|
|
17
17
|
static jsonSchema = {
|
|
18
18
|
type: 'object',
|
|
19
|
-
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price'],
|
|
19
|
+
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price', 'archived'],
|
|
20
20
|
properties: {
|
|
21
21
|
publicKey: { type: 'string' },
|
|
22
22
|
mint: { type: 'string' },
|
|
@@ -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) => {
|
package/package.json
CHANGED
|
@@ -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
|
+
};
|
package/src/models/Release.js
CHANGED
|
@@ -18,7 +18,7 @@ export default class Release extends Model {
|
|
|
18
18
|
static idColumn = 'id';
|
|
19
19
|
static jsonSchema = {
|
|
20
20
|
type: 'object',
|
|
21
|
-
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price'],
|
|
21
|
+
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price', 'archived'],
|
|
22
22
|
properties: {
|
|
23
23
|
publicKey: { type: 'string' },
|
|
24
24
|
mint: { type: 'string' },
|
|
@@ -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
|
|