@aws-amplify/graphql-model-transformer 1.3.6 → 1.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.
Files changed (155) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/definitions.d.ts.map +1 -1
  3. package/lib/definitions.js +28 -2
  4. package/lib/definitions.js.map +1 -1
  5. package/lib/graphql-model-transformer.d.ts.map +1 -1
  6. package/lib/graphql-model-transformer.js +37 -35
  7. package/lib/graphql-model-transformer.js.map +1 -1
  8. package/lib/graphql-types/common.d.ts.map +1 -1
  9. package/lib/graphql-types/common.js +16 -18
  10. package/lib/graphql-types/common.js.map +1 -1
  11. package/lib/graphql-types/mutation.js +12 -12
  12. package/lib/graphql-types/mutation.js.map +1 -1
  13. package/lib/rds-lambda.zip +0 -0
  14. package/lib/resolvers/common.d.ts.map +1 -1
  15. package/lib/resolvers/common.js.map +1 -1
  16. package/lib/resolvers/dynamodb/mutation.d.ts.map +1 -1
  17. package/lib/resolvers/dynamodb/mutation.js +10 -8
  18. package/lib/resolvers/dynamodb/mutation.js.map +1 -1
  19. package/lib/resolvers/dynamodb/query.d.ts.map +1 -1
  20. package/lib/resolvers/dynamodb/query.js +1 -4
  21. package/lib/resolvers/dynamodb/query.js.map +1 -1
  22. package/lib/resolvers/dynamodb/subscriptions.d.ts.map +1 -1
  23. package/lib/resolvers/dynamodb/subscriptions.js.map +1 -1
  24. package/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  25. package/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  26. package/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
  27. package/lib/resolvers/index.d.ts.map +1 -1
  28. package/lib/resolvers/index.js.map +1 -1
  29. package/lib/resolvers/rds/mutation.d.ts.map +1 -1
  30. package/lib/resolvers/rds/mutation.js.map +1 -1
  31. package/lib/resolvers/rds/query.d.ts.map +1 -1
  32. package/lib/resolvers/rds/query.js.map +1 -1
  33. package/lib/resolvers/rds/resolver.d.ts.map +1 -1
  34. package/lib/resolvers/rds/resolver.js +1 -1
  35. package/lib/resolvers/rds/resolver.js.map +1 -1
  36. package/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
  37. package/lib/resources/dynamo-model-resource-generator.js.map +1 -1
  38. package/lib/resources/model-resource-generator.d.ts.map +1 -1
  39. package/lib/resources/model-resource-generator.js +12 -4
  40. package/lib/resources/model-resource-generator.js.map +1 -1
  41. package/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  42. package/lib/resources/rds-model-resource-generator.js +1 -1
  43. package/lib/resources/rds-model-resource-generator.js.map +1 -1
  44. package/package.json +7 -7
  45. package/rds-lambda/node_modules/.package-lock.json +215 -227
  46. package/rds-lambda/node_modules/@aws-sdk/client-ssm/package.json +17 -18
  47. package/rds-lambda/node_modules/@aws-sdk/client-sso/package.json +14 -15
  48. package/rds-lambda/node_modules/@aws-sdk/client-sso-oidc/package.json +14 -15
  49. package/rds-lambda/node_modules/@aws-sdk/client-sts/package.json +17 -18
  50. package/rds-lambda/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  51. package/rds-lambda/node_modules/@aws-sdk/credential-provider-ini/package.json +6 -6
  52. package/rds-lambda/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  53. package/rds-lambda/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  54. package/rds-lambda/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  55. package/rds-lambda/node_modules/@aws-sdk/credential-provider-web-identity/package.json +2 -2
  56. package/rds-lambda/node_modules/@aws-sdk/middleware-host-header/package.json +2 -2
  57. package/rds-lambda/node_modules/@aws-sdk/middleware-logger/package.json +2 -2
  58. package/rds-lambda/node_modules/@aws-sdk/middleware-recursion-detection/package.json +2 -2
  59. package/rds-lambda/node_modules/@aws-sdk/middleware-sdk-sts/package.json +3 -3
  60. package/rds-lambda/node_modules/@aws-sdk/middleware-signing/package.json +2 -2
  61. package/rds-lambda/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  62. package/rds-lambda/node_modules/@aws-sdk/token-providers/package.json +3 -3
  63. package/rds-lambda/node_modules/@aws-sdk/types/package.json +2 -1
  64. package/rds-lambda/node_modules/@aws-sdk/util-endpoints/package.json +2 -2
  65. package/rds-lambda/node_modules/@aws-sdk/util-user-agent-browser/package.json +2 -2
  66. package/rds-lambda/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  67. package/rds-lambda/node_modules/@babel/compat-data/data/plugin-bugfixes.json +2 -0
  68. package/rds-lambda/node_modules/@babel/compat-data/data/plugins.json +8 -0
  69. package/rds-lambda/node_modules/@babel/compat-data/package.json +1 -1
  70. package/rds-lambda/node_modules/@babel/core/package.json +7 -7
  71. package/rds-lambda/node_modules/@babel/generator/package.json +2 -2
  72. package/rds-lambda/node_modules/@babel/helper-compilation-targets/package.json +5 -5
  73. package/rds-lambda/node_modules/@babel/helper-module-transforms/README.md +1 -1
  74. package/rds-lambda/node_modules/@babel/helper-module-transforms/package.json +10 -6
  75. package/rds-lambda/node_modules/@types/jest/README.md +1 -1
  76. package/rds-lambda/node_modules/@types/jest/package.json +2 -2
  77. package/rds-lambda/node_modules/@types/node/README.md +1 -1
  78. package/rds-lambda/node_modules/@types/node/package.json +2 -2
  79. package/rds-lambda/node_modules/caniuse-lite/package.json +1 -1
  80. package/rds-lambda/node_modules/commander/Readme.md +7 -2
  81. package/rds-lambda/node_modules/commander/package.json +17 -17
  82. package/rds-lambda/node_modules/electron-to-chromium/full-chromium-versions.json +1 -1
  83. package/rds-lambda/node_modules/electron-to-chromium/full-versions.json +1 -1
  84. package/rds-lambda/node_modules/electron-to-chromium/package.json +1 -1
  85. package/rds-lambda/node_modules/electron-to-chromium/versions.json +1 -1
  86. package/rds-lambda/node_modules/jest-snapshot/node_modules/semver/package.json +3 -3
  87. package/rds-lambda/node_modules/knex/CHANGELOG.md +63 -21
  88. package/rds-lambda/node_modules/knex/CONTRIBUTING.md +1 -1
  89. package/rds-lambda/node_modules/knex/LICENSE +22 -22
  90. package/rds-lambda/node_modules/knex/README.md +32 -31
  91. package/rds-lambda/node_modules/knex/UPGRADING.md +94 -82
  92. package/rds-lambda/node_modules/knex/knex.mjs +11 -0
  93. package/rds-lambda/node_modules/knex/lib/dialects/oracle/DEAD_CODE.md +3 -3
  94. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/cjs.stub +15 -15
  95. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/coffee.stub +13 -13
  96. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/eg.stub +14 -14
  97. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/js-schema.stub +22 -22
  98. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/js.stub +22 -22
  99. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-coffee.stub +34 -34
  100. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-eg.stub +43 -43
  101. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-js.stub +47 -47
  102. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-ls.stub +35 -35
  103. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-ts.stub +47 -47
  104. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ls.stub +14 -14
  105. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/mjs.stub +23 -23
  106. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub +21 -21
  107. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ts.stub +21 -21
  108. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/coffee.stub +9 -9
  109. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/eg.stub +11 -11
  110. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/js.stub +13 -13
  111. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/ls.stub +11 -11
  112. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/mjs.stub +12 -12
  113. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/ts.stub +13 -13
  114. package/rds-lambda/node_modules/knex/package.json +21 -18
  115. package/rds-lambda/node_modules/knex/scripts/docker-compose.yml +2 -2
  116. package/rds-lambda/node_modules/knex/scripts/next-release-howto.md +1 -1
  117. package/rds-lambda/node_modules/knex/scripts/oracledb-install-driver-libs.sh +82 -82
  118. package/rds-lambda/node_modules/knex/scripts/release.sh +36 -34
  119. package/rds-lambda/node_modules/knex/scripts/stress-test/README.txt +18 -18
  120. package/rds-lambda/node_modules/knex/scripts/stress-test/docker-compose.yml +16 -16
  121. package/rds-lambda/node_modules/pg-connection-string/package.json +2 -2
  122. package/rds-lambda/node_modules/semver/package.json +19 -9
  123. package/rds-lambda/node_modules/ts-jest/node_modules/semver/package.json +3 -3
  124. package/rds-lambda/package-lock.json +215 -227
  125. package/src/__tests__/model-transformer.test.ts +130 -139
  126. package/src/__tests__/test-utils/helpers.ts +1 -1
  127. package/src/__tests__/test-utils/rds_utils.test.ts +29 -68
  128. package/src/definitions.ts +28 -2
  129. package/src/graphql-model-transformer.ts +72 -74
  130. package/src/graphql-types/common.ts +41 -41
  131. package/src/graphql-types/mutation.ts +12 -12
  132. package/src/resolvers/common.ts +1 -12
  133. package/src/resolvers/dynamodb/mutation.ts +16 -13
  134. package/src/resolvers/dynamodb/query.ts +6 -12
  135. package/src/resolvers/dynamodb/subscriptions.ts +1 -3
  136. package/src/resolvers/generators/rds-vtl-generator.ts +1 -4
  137. package/src/resolvers/generators/vtl-generator.ts +5 -5
  138. package/src/resolvers/index.ts +1 -3
  139. package/src/resolvers/rds/mutation.ts +17 -6
  140. package/src/resolvers/rds/query.ts +4 -12
  141. package/src/resolvers/rds/resolver.ts +8 -13
  142. package/src/resources/dynamo-model-resource-generator.ts +12 -22
  143. package/src/resources/model-resource-generator.ts +54 -24
  144. package/src/resources/rds-model-resource-generator.ts +9 -23
  145. package/tsconfig.json +4 -4
  146. package/tsconfig.tsbuildinfo +1 -1
  147. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/CHANGELOG.md +0 -70
  148. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/LICENSE +0 -15
  149. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/README.md +0 -454
  150. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/package.json +0 -28
  151. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/range.bnf +0 -16
  152. package/rds-lambda/node_modules/pg/node_modules/pg-connection-string/LICENSE +0 -21
  153. package/rds-lambda/node_modules/pg/node_modules/pg-connection-string/README.md +0 -77
  154. package/rds-lambda/node_modules/pg/node_modules/pg-connection-string/package.json +0 -40
  155. package/rds-lambda/node_modules/semver/CHANGELOG.md +0 -70
@@ -1,43 +1,43 @@
1
- ;; Update with your config settings.
2
-
3
- module.exports = {
4
- development = {
5
- client = 'sqlite3'
6
- connection = {
7
- filename = './dev.sqlite3'
8
- }
9
- migrations = {
10
- tableName = 'knex_migrations'
11
- }
12
- }
13
- staging = {
14
- client = 'postgresql'
15
- connection = {
16
- database = 'my_db'
17
- user = 'username'
18
- password = 'password'
19
- }
20
- pool = {
21
- min = 2
22
- max = 10
23
- }
24
- migrations = {
25
- tableName = 'knex_migrations'
26
- }
27
- }
28
- production = {
29
- client = 'postgresql'
30
- connection = {
31
- database = 'my_db'
32
- user = 'username'
33
- password = 'password'
34
- }
35
- pool = {
36
- min = 2
37
- max = 10
38
- }
39
- migrations = {
40
- tableName = 'knex_migrations'
41
- }
42
- }
43
- }
1
+ ;; Update with your config settings.
2
+
3
+ module.exports = {
4
+ development = {
5
+ client = 'sqlite3'
6
+ connection = {
7
+ filename = './dev.sqlite3'
8
+ }
9
+ migrations = {
10
+ tableName = 'knex_migrations'
11
+ }
12
+ }
13
+ staging = {
14
+ client = 'postgresql'
15
+ connection = {
16
+ database = 'my_db'
17
+ user = 'username'
18
+ password = 'password'
19
+ }
20
+ pool = {
21
+ min = 2
22
+ max = 10
23
+ }
24
+ migrations = {
25
+ tableName = 'knex_migrations'
26
+ }
27
+ }
28
+ production = {
29
+ client = 'postgresql'
30
+ connection = {
31
+ database = 'my_db'
32
+ user = 'username'
33
+ password = 'password'
34
+ }
35
+ pool = {
36
+ min = 2
37
+ max = 10
38
+ }
39
+ migrations = {
40
+ tableName = 'knex_migrations'
41
+ }
42
+ }
43
+ }
@@ -1,47 +1,47 @@
1
- // Update with your config settings.
2
-
3
- /**
4
- * @type { Object.<string, import("knex").Knex.Config> }
5
- */
6
- module.exports = {
7
-
8
- development: {
9
- client: 'sqlite3',
10
- connection: {
11
- filename: './dev.sqlite3'
12
- }
13
- },
14
-
15
- staging: {
16
- client: 'postgresql',
17
- connection: {
18
- database: 'my_db',
19
- user: 'username',
20
- password: 'password'
21
- },
22
- pool: {
23
- min: 2,
24
- max: 10
25
- },
26
- migrations: {
27
- tableName: 'knex_migrations'
28
- }
29
- },
30
-
31
- production: {
32
- client: 'postgresql',
33
- connection: {
34
- database: 'my_db',
35
- user: 'username',
36
- password: 'password'
37
- },
38
- pool: {
39
- min: 2,
40
- max: 10
41
- },
42
- migrations: {
43
- tableName: 'knex_migrations'
44
- }
45
- }
46
-
47
- };
1
+ // Update with your config settings.
2
+
3
+ /**
4
+ * @type { Object.<string, import("knex").Knex.Config> }
5
+ */
6
+ module.exports = {
7
+
8
+ development: {
9
+ client: 'sqlite3',
10
+ connection: {
11
+ filename: './dev.sqlite3'
12
+ }
13
+ },
14
+
15
+ staging: {
16
+ client: 'postgresql',
17
+ connection: {
18
+ database: 'my_db',
19
+ user: 'username',
20
+ password: 'password'
21
+ },
22
+ pool: {
23
+ min: 2,
24
+ max: 10
25
+ },
26
+ migrations: {
27
+ tableName: 'knex_migrations'
28
+ }
29
+ },
30
+
31
+ production: {
32
+ client: 'postgresql',
33
+ connection: {
34
+ database: 'my_db',
35
+ user: 'username',
36
+ password: 'password'
37
+ },
38
+ pool: {
39
+ min: 2,
40
+ max: 10
41
+ },
42
+ migrations: {
43
+ tableName: 'knex_migrations'
44
+ }
45
+ }
46
+
47
+ };
@@ -1,35 +1,35 @@
1
- # Update with your config settings.
2
-
3
- module.exports =
4
-
5
- development:
6
- client: 'sqlite3'
7
- connection:
8
- filename: './dev.sqlite3'
9
- migrations:
10
- tableName: 'knex_migrations'
11
-
12
- staging:
13
- client: 'postgresql'
14
- connection:
15
- database: 'my_db'
16
- user: 'username'
17
- password: 'password'
18
- pool:
19
- min: 2
20
- max: 10
21
- migrations:
22
- tableName: 'knex_migrations'
23
-
24
- production:
25
- client: 'postgresql'
26
- connection:
27
- database: 'my_db'
28
- user: 'username'
29
- password: 'password'
30
- pool:
31
- min: 2
32
- max: 10
33
- migrations:
34
- tableName: 'knex_migrations'
35
-
1
+ # Update with your config settings.
2
+
3
+ module.exports =
4
+
5
+ development:
6
+ client: 'sqlite3'
7
+ connection:
8
+ filename: './dev.sqlite3'
9
+ migrations:
10
+ tableName: 'knex_migrations'
11
+
12
+ staging:
13
+ client: 'postgresql'
14
+ connection:
15
+ database: 'my_db'
16
+ user: 'username'
17
+ password: 'password'
18
+ pool:
19
+ min: 2
20
+ max: 10
21
+ migrations:
22
+ tableName: 'knex_migrations'
23
+
24
+ production:
25
+ client: 'postgresql'
26
+ connection:
27
+ database: 'my_db'
28
+ user: 'username'
29
+ password: 'password'
30
+ pool:
31
+ min: 2
32
+ max: 10
33
+ migrations:
34
+ tableName: 'knex_migrations'
35
+
@@ -1,47 +1,47 @@
1
- import type { Knex } from "knex";
2
-
3
- // Update with your config settings.
4
-
5
- const config: { [key: string]: Knex.Config } = {
6
- development: {
7
- client: "sqlite3",
8
- connection: {
9
- filename: "./dev.sqlite3"
10
- }
11
- },
12
-
13
- staging: {
14
- client: "postgresql",
15
- connection: {
16
- database: "my_db",
17
- user: "username",
18
- password: "password"
19
- },
20
- pool: {
21
- min: 2,
22
- max: 10
23
- },
24
- migrations: {
25
- tableName: "knex_migrations"
26
- }
27
- },
28
-
29
- production: {
30
- client: "postgresql",
31
- connection: {
32
- database: "my_db",
33
- user: "username",
34
- password: "password"
35
- },
36
- pool: {
37
- min: 2,
38
- max: 10
39
- },
40
- migrations: {
41
- tableName: "knex_migrations"
42
- }
43
- }
44
-
45
- };
46
-
47
- module.exports = config;
1
+ import type { Knex } from "knex";
2
+
3
+ // Update with your config settings.
4
+
5
+ const config: { [key: string]: Knex.Config } = {
6
+ development: {
7
+ client: "sqlite3",
8
+ connection: {
9
+ filename: "./dev.sqlite3"
10
+ }
11
+ },
12
+
13
+ staging: {
14
+ client: "postgresql",
15
+ connection: {
16
+ database: "my_db",
17
+ user: "username",
18
+ password: "password"
19
+ },
20
+ pool: {
21
+ min: 2,
22
+ max: 10
23
+ },
24
+ migrations: {
25
+ tableName: "knex_migrations"
26
+ }
27
+ },
28
+
29
+ production: {
30
+ client: "postgresql",
31
+ connection: {
32
+ database: "my_db",
33
+ user: "username",
34
+ password: "password"
35
+ },
36
+ pool: {
37
+ min: 2,
38
+ max: 10
39
+ },
40
+ migrations: {
41
+ tableName: "knex_migrations"
42
+ }
43
+ }
44
+
45
+ };
46
+
47
+ module.exports = config;
@@ -1,14 +1,14 @@
1
-
2
- exports.up = (knex, Promise) ->
3
- <% if (d.tableName) { %>
4
- knex.schema.create-table "<%= d.tableName %>", (t) ->
5
- t.increments!
6
- t.timestamp!
7
- <% } %>
8
-
9
-
10
- exports.down = (knex, Promise) ->
11
- <% if (d.tableName) { %>
12
- knex.schema.drop-table "<%= d.tableName %>"
13
- <% } %>
14
-
1
+
2
+ exports.up = (knex, Promise) ->
3
+ <% if (d.tableName) { %>
4
+ knex.schema.create-table "<%= d.tableName %>", (t) ->
5
+ t.increments!
6
+ t.timestamp!
7
+ <% } %>
8
+
9
+
10
+ exports.down = (knex, Promise) ->
11
+ <% if (d.tableName) { %>
12
+ knex.schema.drop-table "<%= d.tableName %>"
13
+ <% } %>
14
+
@@ -1,23 +1,23 @@
1
-
2
- /**
3
- * @param { import("knex").Knex } knex
4
- * @returns { Promise<void> }
5
- */
6
- export const up = async (knex) => {
7
- <% if (d.tableName) { %>
8
- await knex.schema.createTable("<%= d.tableName %>", function(t) {
9
- t.increments();
10
- t.timestamp();
11
- });
12
- <% } %>
13
- };
14
-
15
- /**
16
- * @param { import("knex").Knex } knex
17
- * @returns { Promise<void> }
18
- */
19
- export const down = async (knex) => {
20
- <% if (d.tableName) { %>
21
- await knex.schema.dropTable("<%= d.tableName %>");
22
- <% } %>
23
- };
1
+
2
+ /**
3
+ * @param { import("knex").Knex } knex
4
+ * @returns { Promise<void> }
5
+ */
6
+ export const up = async (knex) => {
7
+ <% if (d.tableName) { %>
8
+ await knex.schema.createTable("<%= d.tableName %>", function(t) {
9
+ t.increments();
10
+ t.timestamp();
11
+ });
12
+ <% } %>
13
+ };
14
+
15
+ /**
16
+ * @param { import("knex").Knex } knex
17
+ * @returns { Promise<void> }
18
+ */
19
+ export const down = async (knex) => {
20
+ <% if (d.tableName) { %>
21
+ await knex.schema.dropTable("<%= d.tableName %>");
22
+ <% } %>
23
+ };
@@ -1,21 +1,21 @@
1
- import { Knex } from "knex";
2
-
3
- <% if (d.tableName) { %>
4
- export async function up({schema}: Knex): Promise<Knex.SchemaBuilder> {
5
- return schema.createTable("<%= d.tableName %>", (t) => {
6
- t.increments();
7
- t.timestamps();
8
- });
9
- }
10
- <% } else { %>
11
- export async function up({schema}: Knex): Promise<void> {
12
- }
13
- <% } %>
14
- <% if (d.tableName) { %>
15
- export async function down({schema}: Knex): Promise<Knex.SchemaBuilder> {
16
- return schema.dropTable("<%= d.tableName %>");
17
- }
18
- <% } else { %>
19
- export async function down({schema}: Knex): Promise<void> {
20
- }
21
- <% } %>
1
+ import { Knex } from "knex";
2
+
3
+ <% if (d.tableName) { %>
4
+ export async function up({schema}: Knex): Promise<Knex.SchemaBuilder> {
5
+ return schema.createTable("<%= d.tableName %>", (t) => {
6
+ t.increments();
7
+ t.timestamps();
8
+ });
9
+ }
10
+ <% } else { %>
11
+ export async function up({schema}: Knex): Promise<void> {
12
+ }
13
+ <% } %>
14
+ <% if (d.tableName) { %>
15
+ export async function down({schema}: Knex): Promise<Knex.SchemaBuilder> {
16
+ return schema.dropTable("<%= d.tableName %>");
17
+ }
18
+ <% } else { %>
19
+ export async function down({schema}: Knex): Promise<void> {
20
+ }
21
+ <% } %>
@@ -1,21 +1,21 @@
1
- import { Knex } from "knex";
2
-
3
- <% if (d.tableName) { %>
4
- export async function up(knex: Knex): Promise<Knex.SchemaBuilder> {
5
- return knex.schema.createTable("<%= d.tableName %>", (t) => {
6
- t.increments();
7
- t.timestamps();
8
- });
9
- }
10
- <% } else { %>
11
- export async function up(knex: Knex): Promise<void> {
12
- }
13
- <% } %>
14
- <% if (d.tableName) { %>
15
- export async function down(knex: Knex): Promise<Knex.SchemaBuilder> {
16
- return knex.schema.dropTable("<%= d.tableName %>");
17
- }
18
- <% } else { %>
19
- export async function down(knex: Knex): Promise<void> {
20
- }
21
- <% } %>
1
+ import { Knex } from "knex";
2
+
3
+ <% if (d.tableName) { %>
4
+ export async function up(knex: Knex): Promise<Knex.SchemaBuilder> {
5
+ return knex.schema.createTable("<%= d.tableName %>", (t) => {
6
+ t.increments();
7
+ t.timestamps();
8
+ });
9
+ }
10
+ <% } else { %>
11
+ export async function up(knex: Knex): Promise<void> {
12
+ }
13
+ <% } %>
14
+ <% if (d.tableName) { %>
15
+ export async function down(knex: Knex): Promise<Knex.SchemaBuilder> {
16
+ return knex.schema.dropTable("<%= d.tableName %>");
17
+ }
18
+ <% } else { %>
19
+ export async function down(knex: Knex): Promise<void> {
20
+ }
21
+ <% } %>
@@ -1,9 +1,9 @@
1
- exports.seed = (knex) ->
2
- knex('table_name').del()
3
- .then () ->
4
- # Inserts seed entries
5
- knex('table_name').insert([
6
- {id: 1, colName: 'rowValue'}
7
- {id: 2, colName: 'rowValue2'}
8
- {id: 3, colName: 'rowValue3'}
9
- ])
1
+ exports.seed = (knex) ->
2
+ knex('table_name').del()
3
+ .then () ->
4
+ # Inserts seed entries
5
+ knex('table_name').insert([
6
+ {id: 1, colName: 'rowValue'}
7
+ {id: 2, colName: 'rowValue2'}
8
+ {id: 3, colName: 'rowValue3'}
9
+ ])
@@ -1,11 +1,11 @@
1
- provide: seed
2
- seed = (knex) ->
3
- ;; Deletes ALL existing entries
4
- knex(.table_name).del()
5
- .then(() ->
6
- ;; Inserts seed entries
7
- knex(.table_name).insert with [
8
- { id = 1, col-name = .row-value-1 }
9
- { id = 2, col-name = .row-value-2 }
10
- { id = 3, col-name = .row-value-3 }
11
- ]
1
+ provide: seed
2
+ seed = (knex) ->
3
+ ;; Deletes ALL existing entries
4
+ knex(.table_name).del()
5
+ .then(() ->
6
+ ;; Inserts seed entries
7
+ knex(.table_name).insert with [
8
+ { id = 1, col-name = .row-value-1 }
9
+ { id = 2, col-name = .row-value-2 }
10
+ { id = 3, col-name = .row-value-3 }
11
+ ]
@@ -1,13 +1,13 @@
1
- /**
2
- * @param { import("knex").Knex } knex
3
- * @returns { Promise<void> }
4
- */
5
- exports.seed = async function(knex) {
6
- // Deletes ALL existing entries
7
- await knex('table_name').del()
8
- await knex('table_name').insert([
9
- {id: 1, colName: 'rowValue1'},
10
- {id: 2, colName: 'rowValue2'},
11
- {id: 3, colName: 'rowValue3'}
12
- ]);
13
- };
1
+ /**
2
+ * @param { import("knex").Knex } knex
3
+ * @returns { Promise<void> }
4
+ */
5
+ exports.seed = async function(knex) {
6
+ // Deletes ALL existing entries
7
+ await knex('table_name').del()
8
+ await knex('table_name').insert([
9
+ {id: 1, colName: 'rowValue1'},
10
+ {id: 2, colName: 'rowValue2'},
11
+ {id: 3, colName: 'rowValue3'}
12
+ ]);
13
+ };
@@ -1,11 +1,11 @@
1
- exports.seed = (knex) ->
2
- # Deletes ALL existing entries
3
- knex('table_name').del()
4
- .then(() ->
5
- # Inserts seed entries
6
- knex('table_name').insert([
7
- {id: 1, colName: 'rowValue1'},
8
- {id: 2, colName: 'rowValue2'},
9
- {id: 3, colName: 'rowValue3'}
10
- ])
11
- )
1
+ exports.seed = (knex) ->
2
+ # Deletes ALL existing entries
3
+ knex('table_name').del()
4
+ .then(() ->
5
+ # Inserts seed entries
6
+ knex('table_name').insert([
7
+ {id: 1, colName: 'rowValue1'},
8
+ {id: 2, colName: 'rowValue2'},
9
+ {id: 3, colName: 'rowValue3'}
10
+ ])
11
+ )
@@ -1,12 +1,12 @@
1
-
2
- export const seed = async (knex) => {
3
- // Deletes ALL existing entries
4
- await knex('table_name').del();
5
-
6
- // Inserts seed entries
7
- await knex('table_name').insert([
8
- {id: 1, colName: 'rowValue1'},
9
- {id: 2, colName: 'rowValue2'},
10
- {id: 3, colName: 'rowValue3'}
11
- ]);
12
- };
1
+
2
+ export const seed = async (knex) => {
3
+ // Deletes ALL existing entries
4
+ await knex('table_name').del();
5
+
6
+ // Inserts seed entries
7
+ await knex('table_name').insert([
8
+ {id: 1, colName: 'rowValue1'},
9
+ {id: 2, colName: 'rowValue2'},
10
+ {id: 3, colName: 'rowValue3'}
11
+ ]);
12
+ };
@@ -1,13 +1,13 @@
1
- import { Knex } from "knex";
2
-
3
- export async function seed(knex: Knex): Promise<void> {
4
- // Deletes ALL existing entries
5
- await knex("table_name").del();
6
-
7
- // Inserts seed entries
8
- await knex("table_name").insert([
9
- { id: 1, colName: "rowValue1" },
10
- { id: 2, colName: "rowValue2" },
11
- { id: 3, colName: "rowValue3" }
12
- ]);
13
- };
1
+ import { Knex } from "knex";
2
+
3
+ export async function seed(knex: Knex): Promise<void> {
4
+ // Deletes ALL existing entries
5
+ await knex("table_name").del();
6
+
7
+ // Inserts seed entries
8
+ await knex("table_name").insert([
9
+ { id: 1, colName: "rowValue1" },
10
+ { id: 2, colName: "rowValue2" },
11
+ { id: 3, colName: "rowValue3" }
12
+ ]);
13
+ };