@axium/storage 0.3.6 → 0.3.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/dist/plugin.js CHANGED
@@ -20,8 +20,8 @@ async function db_init(opt) {
20
20
  await database.schema
21
21
  .createTable('storage')
22
22
  .addColumn('id', 'uuid', col => col.primaryKey().defaultTo(sql `gen_random_uuid()`))
23
- .addColumn('userId', 'uuid', col => col.notNull().references('users.id').onDelete('cascade').onUpdate('cascade'))
24
- .addColumn('parentId', 'uuid', col => col.references('storage.id').onDelete('cascade').onUpdate('cascade').defaultTo(null))
23
+ .addColumn('userId', 'uuid', col => col.notNull().references('users.id').onDelete('cascade'))
24
+ .addColumn('parentId', 'uuid', col => col.references('storage.id').onDelete('cascade').defaultTo(null))
25
25
  .addColumn('createdAt', 'timestamptz', col => col.notNull().defaultTo(sql `now()`))
26
26
  .addColumn('modifiedAt', 'timestamptz', col => col.notNull().defaultTo(sql `now()`))
27
27
  .addColumn('size', 'integer', col => col.notNull())
@@ -31,7 +31,7 @@ async function db_init(opt) {
31
31
  .addColumn('type', 'text', col => col.notNull())
32
32
  .addColumn('immutable', 'boolean', col => col.notNull())
33
33
  .addColumn('publicPermission', 'integer', col => col.notNull().defaultTo(0))
34
- .addColumn('metadata', 'jsonb', col => col.defaultTo('{}'))
34
+ .addColumn('metadata', 'jsonb', col => col.notNull().defaultTo('{}'))
35
35
  .execute()
36
36
  .then(done)
37
37
  .catch(warnExists);
package/dist/server.js CHANGED
@@ -16,14 +16,14 @@ expectedTypes.storage = {
16
16
  createdAt: { type: 'timestamptz', required: true, hasDefault: true },
17
17
  hash: { type: 'bytea', required: true },
18
18
  id: { type: 'uuid', required: true, hasDefault: true },
19
- immutable: { type: 'bool', required: true, hasDefault: true },
19
+ immutable: { type: 'bool', required: true },
20
20
  modifiedAt: { type: 'timestamptz', required: true, hasDefault: true },
21
21
  name: { type: 'text' },
22
22
  parentId: { type: 'uuid' },
23
23
  size: { type: 'int4', required: true },
24
- trashedAt: { type: 'timestampz' },
24
+ trashedAt: { type: 'timestamptz' },
25
25
  type: { type: 'text', required: true },
26
- userId: { type: 'uuid', required: true, hasDefault: true },
26
+ userId: { type: 'uuid', required: true },
27
27
  publicPermission: { type: 'int4', required: true, hasDefault: true },
28
28
  metadata: { type: 'jsonb', required: true, hasDefault: true },
29
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/storage",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "description": "User file storage for Axium",
6
6
  "funding": {