@smartive/graphql-magic 19.1.0-next.4 → 19.1.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- # [19.1.0-next.4](https://github.com/smartive/graphql-magic/compare/v19.1.0-next.3...v19.1.0-next.4) (2025-06-04)
1
+ # [19.1.0](https://github.com/smartive/graphql-magic/compare/v19.0.0...v19.1.0) (2025-06-04)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * Only generate needed enums ([38a34d5](https://github.com/smartive/graphql-magic/commit/38a34d5134838e0941fa1902f9ebd1b6c9466a15))
6
+ * Permissions Typing ([#303](https://github.com/smartive/graphql-magic/issues/303)) ([2be1899](https://github.com/smartive/graphql-magic/commit/2be189913e0fa91cadf805fd715e25c9351e13dd))
@@ -3,10 +3,18 @@ import { Knex } from 'knex';
3
3
  export const up = async (knex: Knex) => {
4
4
  await knex.raw(`CREATE TYPE "someEnum" AS ENUM ('A','B','C')`);
5
5
 
6
+ await knex.raw(`CREATE TYPE "role" AS ENUM ('ADMIN','USER')`);
7
+
6
8
  await knex.raw(`CREATE TYPE "reactionType" AS ENUM ('Review','Question','Answer')`);
7
9
 
8
- await knex.schema.alterTable('User', (table) => {
9
- table.string('username', undefined);
10
+ await knex.schema.createTable('User', (table) => {
11
+ table.uuid('id').notNullable().primary();
12
+ table.string('username', undefined).nullable();
13
+ table.enum('role', null, {
14
+ useNative: true,
15
+ existingType: true,
16
+ enumName: 'role',
17
+ }).notNullable();
10
18
  });
11
19
 
12
20
  await knex.schema.createTable('AnotherObject', (table) => {
@@ -115,29 +123,9 @@ export const up = async (knex: Knex) => {
115
123
  table.decimal('rating', undefined, undefined).nullable();
116
124
  });
117
125
 
118
- await knex.schema.alterTable('User', (table) => {
119
- table.dropColumn('createdAt');
120
- table.dropColumn('updatedAt');
121
- });
122
-
123
126
  };
124
127
 
125
128
  export const down = async (knex: Knex) => {
126
- await knex.schema.alterTable('User', (table) => {
127
- table.timestamp('createdAt');
128
- table.timestamp('updatedAt');
129
- });
130
-
131
- await knex('User').update({
132
- createdAt: 'TODO',
133
- updatedAt: 'TODO',
134
- });
135
-
136
- await knex.schema.alterTable('User', (table) => {
137
- table.timestamp('createdAt').notNullable().alter();
138
- table.timestamp('updatedAt').notNullable().alter();
139
- });
140
-
141
129
  await knex.schema.dropTable('ReviewRevision');
142
130
 
143
131
  await knex.schema.dropTable('Review');
@@ -152,11 +140,10 @@ export const down = async (knex: Knex) => {
152
140
 
153
141
  await knex.schema.dropTable('AnotherObject');
154
142
 
155
- await knex.schema.alterTable('User', (table) => {
156
- table.dropColumn('username');
157
- });
143
+ await knex.schema.dropTable('User');
158
144
 
159
145
  await knex.raw('DROP TYPE "reactionType"');
146
+ await knex.raw('DROP TYPE "role"');
160
147
  await knex.raw('DROP TYPE "someEnum"');
161
148
  };
162
149
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartive/graphql-magic",
3
- "version": "19.1.0-next.4",
3
+ "version": "19.1.0",
4
4
  "description": "",
5
5
  "source": "src/index.ts",
6
6
  "type": "module",