create-absolutejs 0.17.3 → 0.19.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 +16 -0
- package/README.md +37 -4
- package/changelog.json +24 -0
- package/dist/commands/migrateDatabase.d.ts +6 -0
- package/dist/commands/migrateDatabase.js +53 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.js +1 -1
- package/dist/generators/angular/generateAngularPage.d.ts +5 -6
- package/dist/generators/angular/generateAngularPage.js +16 -33
- package/dist/generators/angular/scaffoldAngular.d.ts +1 -1
- package/dist/generators/angular/scaffoldAngular.js +8 -9
- package/dist/generators/configurations/generateDrizzleConfig.d.ts +5 -3
- package/dist/generators/configurations/generateDrizzleConfig.js +40 -14
- package/dist/generators/configurations/generateEnv.js +6 -0
- package/dist/generators/configurations/generateEslintConfig.js +4 -2
- package/dist/generators/configurations/generatePackageJson.js +33 -6
- package/dist/generators/db/drizzleTargets.d.ts +5 -0
- package/dist/generators/db/drizzleTargets.js +27 -0
- package/dist/generators/db/generateDatabaseTypes.js +21 -24
- package/dist/generators/db/generateDockerContainer.d.ts +5 -0
- package/dist/generators/db/generateDockerContainer.js +22 -4
- package/dist/generators/db/generateDrizzleSchema.js +65 -77
- package/dist/generators/db/generateHandlers.js +3 -2
- package/dist/generators/db/generateRelationalSchema.d.ts +1 -1
- package/dist/generators/db/generateRelationalSchema.js +1 -1
- package/dist/generators/db/handlerTemplates.d.ts +11 -5
- package/dist/generators/db/handlerTemplates.js +14 -12
- package/dist/generators/db/scaffoldDatabase.d.ts +2 -1
- package/dist/generators/db/scaffoldDatabase.js +25 -10
- package/dist/generators/db/scaffoldDocker.d.ts +3 -1
- package/dist/generators/db/scaffoldDocker.js +11 -5
- package/dist/generators/htmx/scaffoldHTMX.js +1 -0
- package/dist/generators/project/generateAbsoluteAuthConfig.d.ts +1 -1
- package/dist/generators/project/generateAbsoluteAuthConfig.js +11 -10
- package/dist/generators/project/generateDBBlock.js +16 -7
- package/dist/generators/project/generateIdentity.d.ts +1 -0
- package/dist/generators/project/generateIdentity.js +15 -0
- package/dist/generators/project/generateImportsBlock.js +15 -15
- package/dist/generators/project/generateRoutesBlock.d.ts +2 -1
- package/dist/generators/project/generateRoutesBlock.js +8 -13
- package/dist/generators/project/generateServer.js +26 -16
- package/dist/generators/project/scaffoldAgentic.d.ts +1 -1
- package/dist/generators/project/scaffoldAgentic.js +45 -45
- package/dist/generators/project/scaffoldBackend.js +4 -9
- package/dist/generators/react/scaffoldReact.js +2 -2
- package/dist/index.js +2 -1
- package/dist/messages.d.ts +2 -1
- package/dist/messages.js +2 -1
- package/dist/prompt.js +3 -2
- package/dist/questions/authOption.js +4 -1
- package/dist/questions/databaseEngine.d.ts +1 -1
- package/dist/questions/orm.js +2 -5
- package/dist/scaffold.d.ts +3 -1
- package/dist/scaffold.js +33 -4
- package/dist/templates/configurations/eslint.config.example.mjs +81 -41
- package/dist/templates/db/migrations/cockroach-count-history/20260926210314_init/migration.sql +5 -0
- package/dist/templates/db/migrations/cockroach-count-history/20260926210314_init/snapshot.json +69 -0
- package/dist/templates/db/migrations/cockroach-users/20260926210315_init/migration.sql +5 -0
- package/dist/templates/db/migrations/cockroach-users/20260926210315_init/snapshot.json +62 -0
- package/dist/templates/db/migrations/mssql-count-history/20260926210316_init/migration.sql +6 -0
- package/dist/templates/db/migrations/mssql-count-history/20260926210316_init/snapshot.json +64 -0
- package/dist/templates/db/migrations/mssql-users/20260926210317_init/migration.sql +6 -0
- package/dist/templates/db/migrations/mssql-users/20260926210317_init/snapshot.json +70 -0
- package/dist/templates/db/migrations/mysql-count-history/20260926210318_init/migration.sql +5 -0
- package/dist/templates/db/migrations/mysql-count-history/20260926210318_init/snapshot.json +61 -0
- package/dist/templates/db/migrations/mysql-users/20260926210319_init/migration.sql +5 -0
- package/dist/templates/db/migrations/mysql-users/20260926210319_init/snapshot.json +61 -0
- package/dist/templates/db/migrations/postgresql-count-history/20260926210320_init/migration.sql +5 -0
- package/dist/templates/db/migrations/postgresql-count-history/20260926210320_init/snapshot.json +71 -0
- package/dist/templates/db/migrations/postgresql-users/20260926210320_init/migration.sql +5 -0
- package/dist/templates/db/migrations/postgresql-users/20260926210320_init/snapshot.json +62 -0
- package/dist/templates/db/migrations/singlestore-count-history/20260926210321_init/migration.sql +5 -0
- package/dist/templates/db/migrations/singlestore-count-history/20260926210321_init/snapshot.json +61 -0
- package/dist/templates/db/migrations/singlestore-users/20260926210322_init/migration.sql +5 -0
- package/dist/templates/db/migrations/singlestore-users/20260926210322_init/snapshot.json +61 -0
- package/dist/templates/db/migrations/sqlite-count-history/20260926210323_init/migration.sql +5 -0
- package/dist/templates/db/migrations/sqlite-count-history/20260926210323_init/snapshot.json +50 -0
- package/dist/templates/db/migrations/sqlite-users/20260926210324_init/migration.sql +5 -0
- package/dist/templates/db/migrations/sqlite-users/20260926210324_init/snapshot.json +50 -0
- package/dist/templates/db/migrations/turso-count-history/20260926210324_init/migration.sql +5 -0
- package/dist/templates/db/migrations/turso-count-history/20260926210324_init/snapshot.json +50 -0
- package/dist/templates/db/migrations/turso-users/20260926210325_init/migration.sql +5 -0
- package/dist/templates/db/migrations/turso-users/20260926210325_init/snapshot.json +50 -0
- package/dist/templates/git/gitignore +0 -3
- package/dist/templates/htmx/LICENSE +13 -0
- package/dist/templates/htmx/htmx.2.0.11.min.js +1 -0
- package/dist/typeGuards.js +2 -2
- package/dist/utils/abort.d.ts +1 -1
- package/dist/utils/abort.js +2 -4
- package/dist/utils/getPackageVersion.js +7 -2
- package/dist/utils/parseCommandLineOptions.js +17 -34
- package/dist/utils/registryChannel.d.ts +2 -0
- package/dist/utils/registryChannel.js +20 -0
- package/dist/utils/validateDatabaseSelection.d.ts +11 -0
- package/dist/utils/validateDatabaseSelection.js +31 -0
- package/dist/versions.d.ts +66 -65
- package/dist/versions.js +66 -65
- package/package.json +27 -22
- package/dist/templates/configurations/drizzle.config.ts +0 -13
- package/dist/templates/htmx/htmx.2.0.6.min.js +0 -1
package/dist/scaffold.js
CHANGED
|
@@ -4,14 +4,31 @@ import { fileURLToPath } from 'url';
|
|
|
4
4
|
import { formatProject } from './commands/formatProject';
|
|
5
5
|
import { initializeGit } from './commands/initializeGit';
|
|
6
6
|
import { installDependencies } from './commands/installDependencies';
|
|
7
|
+
import { migrateDatabase } from './commands/migrateDatabase';
|
|
7
8
|
import { createPackageJson } from './generators/configurations/generatePackageJson';
|
|
8
9
|
import { initalizeRoot } from './generators/configurations/initializeRoot';
|
|
9
10
|
import { scaffoldConfigurationFiles } from './generators/configurations/scaffoldConfigurationFiles';
|
|
10
11
|
import { scaffoldDatabase } from './generators/db/scaffoldDatabase';
|
|
12
|
+
import { scaffoldAgentic } from './generators/project/scaffoldAgentic';
|
|
11
13
|
import { scaffoldBackend } from './generators/project/scaffoldBackend';
|
|
12
14
|
import { scaffoldFrontends } from './generators/project/scaffoldFrontends';
|
|
13
|
-
import {
|
|
14
|
-
export const scaffold = async ({ response: { agentic, projectName, codeQualityTool, initializeGitNow, githubLink, githubRepoUrl, githubVisibility, databaseEngine, databaseHost, useHTMLScripts, useTailwind, databaseDirectory, absProviders, includeExamples, orm, frontends, plugins, authOption, buildDirectory, assetsDirectory, tailwind, installDependenciesNow, frontendDirectories }, latest, envVariables, packageManager }) => {
|
|
15
|
+
import { validateDatabaseSelection } from './utils/validateDatabaseSelection';
|
|
16
|
+
export const scaffold = async ({ response: { agentic, projectName, codeQualityTool, initializeGitNow, githubLink, githubRepoUrl, githubVisibility, databaseEngine, databaseHost, useHTMLScripts, useTailwind, databaseDirectory, absProviders, includeExamples, orm, frontends, plugins, authOption, buildDirectory, assetsDirectory, tailwind, installDependenciesNow, frontendDirectories }, latest, verifyLocalDatabase = true, envVariables, packageManager }) => {
|
|
17
|
+
const { errors: databaseErrors } = validateDatabaseSelection({
|
|
18
|
+
databaseEngine,
|
|
19
|
+
databaseHost,
|
|
20
|
+
orm
|
|
21
|
+
});
|
|
22
|
+
if (databaseErrors.length > 0)
|
|
23
|
+
throw new Error(databaseErrors.join('\n'));
|
|
24
|
+
if (orm === 'prisma')
|
|
25
|
+
throw new Error('Prisma scaffolding is not implemented. Choose Drizzle or no ORM.');
|
|
26
|
+
if (authOption === 'abs' && (!databaseEngine || databaseEngine === 'none'))
|
|
27
|
+
throw new Error('Authentication requires a database for persistent users. Select a database or omit --auth.');
|
|
28
|
+
if (authOption === 'abs' &&
|
|
29
|
+
(!absProviders?.length ||
|
|
30
|
+
absProviders.some((provider) => provider !== 'google')))
|
|
31
|
+
throw new Error('Automatic auth scaffolding currently supports --abs-provider google. Configure other providers with the auth package after creation.');
|
|
15
32
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
33
|
const templatesDirectory = join(__dirname, '/templates');
|
|
17
34
|
const { frontendDirectory, backendDirectory, projectAssetsDirectory, typesDirectory } = initalizeRoot(projectName, templatesDirectory);
|
|
@@ -70,7 +87,8 @@ export const scaffold = async ({ response: { agentic, projectName, codeQualityTo
|
|
|
70
87
|
databaseHost,
|
|
71
88
|
orm,
|
|
72
89
|
projectName,
|
|
73
|
-
typesDirectory
|
|
90
|
+
typesDirectory,
|
|
91
|
+
verifyLocalDatabase
|
|
74
92
|
});
|
|
75
93
|
({ dockerFreshInstall } = result);
|
|
76
94
|
}
|
|
@@ -103,6 +121,14 @@ export const server = treaty<Api>(serverUrl)
|
|
|
103
121
|
if (installDependenciesNow) {
|
|
104
122
|
await installDependencies(packageManager, projectName);
|
|
105
123
|
}
|
|
124
|
+
const databaseMigrated = orm === 'drizzle' &&
|
|
125
|
+
installDependenciesNow &&
|
|
126
|
+
(await migrateDatabase({
|
|
127
|
+
databaseEngine,
|
|
128
|
+
databaseHost,
|
|
129
|
+
projectName,
|
|
130
|
+
verifyLocalDatabase
|
|
131
|
+
}));
|
|
106
132
|
await formatProject({
|
|
107
133
|
installDependenciesNow,
|
|
108
134
|
packageManager,
|
|
@@ -116,5 +142,8 @@ export const server = treaty<Api>(serverUrl)
|
|
|
116
142
|
projectName
|
|
117
143
|
});
|
|
118
144
|
}
|
|
119
|
-
return {
|
|
145
|
+
return {
|
|
146
|
+
databaseMigrationPending: orm === 'drizzle' && !databaseMigrated,
|
|
147
|
+
dockerFreshInstall
|
|
148
|
+
};
|
|
120
149
|
};
|
|
@@ -1,47 +1,87 @@
|
|
|
1
|
-
|
|
2
1
|
import { defineConfig } from 'eslint/config';
|
|
3
|
-
import tseslint from 'typescript-eslint';
|
|
4
2
|
import absolute from 'eslint-plugin-absolute';
|
|
5
3
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import tseslint from 'typescript-eslint';
|
|
6
5
|
|
|
7
6
|
export default defineConfig([
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
7
|
+
{
|
|
8
|
+
ignores: [
|
|
9
|
+
'node_modules/**',
|
|
10
|
+
'build/**',
|
|
11
|
+
'dist/**',
|
|
12
|
+
'.absolutejs/**',
|
|
13
|
+
'.data/**',
|
|
14
|
+
'**/.absolutejs-hmr-*',
|
|
15
|
+
'drizzle/**'
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
linterOptions: {
|
|
20
|
+
noInlineConfig: true,
|
|
21
|
+
reportUnusedDisableDirectives: 'error'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
...tseslint.configs.recommended,
|
|
25
|
+
{
|
|
26
|
+
files: ['**/*.{ts,tsx,js,jsx,mjs}'],
|
|
27
|
+
plugins: { absolute },
|
|
28
|
+
rules: {
|
|
29
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
30
|
+
'error',
|
|
31
|
+
{
|
|
32
|
+
'ts-check': true,
|
|
33
|
+
'ts-expect-error': true,
|
|
34
|
+
'ts-ignore': true,
|
|
35
|
+
'ts-nocheck': true
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
'absolute/button-icon-is-hidden': 'error',
|
|
39
|
+
'absolute/elysia-composition-boundaries': 'error',
|
|
40
|
+
'absolute/icon-button-has-accessible-name': 'error',
|
|
41
|
+
'absolute/loading-indicator-has-aria-busy': 'error',
|
|
42
|
+
'absolute/no-chained-type-assertions': 'error',
|
|
43
|
+
'absolute/no-nondeterministic-render': 'error',
|
|
44
|
+
'absolute/no-unsafe-schema-types': 'error',
|
|
45
|
+
'absolute/prefer-drizzle-query-builders': 'error',
|
|
46
|
+
'absolute/progressbar-has-state': 'error'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
files: ['src/backend/**/*.{ts,tsx}'],
|
|
51
|
+
rules: { 'absolute/elysia-no-response-return': 'error' }
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
files: ['src/frontend/**/*.{ts,tsx,js,jsx}'],
|
|
55
|
+
rules: {
|
|
56
|
+
'absolute/eden-requires-react-query': 'error',
|
|
57
|
+
'no-restricted-syntax': [
|
|
58
|
+
'error',
|
|
59
|
+
{
|
|
60
|
+
message: 'Use a directly typed Eden subapp client.',
|
|
61
|
+
selector: "CallExpression[callee.name='fetch']"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
message: 'Use a directly typed Eden subapp client.',
|
|
65
|
+
selector: "CallExpression[callee.property.name='fetch']"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
files: ['**/*.{html,vue,svelte,gjs,gts}'],
|
|
72
|
+
plugins: { absolute },
|
|
73
|
+
processor: 'absolute/template-source'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
// React Hooks rules do not apply to Angular's unrelated usePageContext API.
|
|
77
|
+
files: [
|
|
78
|
+
'src/frontend/**/*.{tsx,jsx}',
|
|
79
|
+
'src/frontend/**/hooks/**/*.{ts,js}'
|
|
80
|
+
],
|
|
81
|
+
plugins: { 'react-hooks': reactHooks },
|
|
82
|
+
rules: {
|
|
83
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
84
|
+
'react-hooks/rules-of-hooks': 'error'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
47
87
|
]);
|
package/dist/templates/db/migrations/cockroach-count-history/20260926210314_init/snapshot.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1",
|
|
3
|
+
"dialect": "cockroach",
|
|
4
|
+
"id": "25a4568e-927c-4251-8f0c-145bd20ef6cf",
|
|
5
|
+
"prevIds": ["00000000-0000-0000-0000-000000000000"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"isRlsEnabled": false,
|
|
9
|
+
"name": "count_history",
|
|
10
|
+
"entityType": "tables",
|
|
11
|
+
"schema": "public"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "int4",
|
|
15
|
+
"typeSchema": null,
|
|
16
|
+
"notNull": true,
|
|
17
|
+
"dimensions": 0,
|
|
18
|
+
"default": null,
|
|
19
|
+
"generated": null,
|
|
20
|
+
"identity": {
|
|
21
|
+
"type": "always",
|
|
22
|
+
"increment": "1",
|
|
23
|
+
"startWith": "1",
|
|
24
|
+
"minValue": "1",
|
|
25
|
+
"maxValue": "2147483647",
|
|
26
|
+
"cache": 1
|
|
27
|
+
},
|
|
28
|
+
"name": "uid",
|
|
29
|
+
"entityType": "columns",
|
|
30
|
+
"schema": "public",
|
|
31
|
+
"table": "count_history"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "int4",
|
|
35
|
+
"typeSchema": null,
|
|
36
|
+
"notNull": true,
|
|
37
|
+
"dimensions": 0,
|
|
38
|
+
"default": null,
|
|
39
|
+
"generated": null,
|
|
40
|
+
"identity": null,
|
|
41
|
+
"name": "count",
|
|
42
|
+
"entityType": "columns",
|
|
43
|
+
"schema": "public",
|
|
44
|
+
"table": "count_history"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "timestamp",
|
|
48
|
+
"typeSchema": null,
|
|
49
|
+
"notNull": true,
|
|
50
|
+
"dimensions": 0,
|
|
51
|
+
"default": "now()",
|
|
52
|
+
"generated": null,
|
|
53
|
+
"identity": null,
|
|
54
|
+
"name": "created_at",
|
|
55
|
+
"entityType": "columns",
|
|
56
|
+
"schema": "public",
|
|
57
|
+
"table": "count_history"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"columns": ["uid"],
|
|
61
|
+
"nameExplicit": false,
|
|
62
|
+
"name": "count_history_pkey",
|
|
63
|
+
"schema": "public",
|
|
64
|
+
"table": "count_history",
|
|
65
|
+
"entityType": "pks"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"renames": []
|
|
69
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1",
|
|
3
|
+
"dialect": "cockroach",
|
|
4
|
+
"id": "b7fed725-7fff-4c26-8562-5dbb3a0e1a7a",
|
|
5
|
+
"prevIds": ["00000000-0000-0000-0000-000000000000"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"isRlsEnabled": false,
|
|
9
|
+
"name": "users",
|
|
10
|
+
"entityType": "tables",
|
|
11
|
+
"schema": "public"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "varchar(255)",
|
|
15
|
+
"typeSchema": null,
|
|
16
|
+
"notNull": true,
|
|
17
|
+
"dimensions": 0,
|
|
18
|
+
"default": null,
|
|
19
|
+
"generated": null,
|
|
20
|
+
"identity": null,
|
|
21
|
+
"name": "auth_sub",
|
|
22
|
+
"entityType": "columns",
|
|
23
|
+
"schema": "public",
|
|
24
|
+
"table": "users"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "timestamp",
|
|
28
|
+
"typeSchema": null,
|
|
29
|
+
"notNull": true,
|
|
30
|
+
"dimensions": 0,
|
|
31
|
+
"default": "now()",
|
|
32
|
+
"generated": null,
|
|
33
|
+
"identity": null,
|
|
34
|
+
"name": "created_at",
|
|
35
|
+
"entityType": "columns",
|
|
36
|
+
"schema": "public",
|
|
37
|
+
"table": "users"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "jsonb",
|
|
41
|
+
"typeSchema": null,
|
|
42
|
+
"notNull": false,
|
|
43
|
+
"dimensions": 0,
|
|
44
|
+
"default": "'{}'",
|
|
45
|
+
"generated": null,
|
|
46
|
+
"identity": null,
|
|
47
|
+
"name": "metadata",
|
|
48
|
+
"entityType": "columns",
|
|
49
|
+
"schema": "public",
|
|
50
|
+
"table": "users"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"columns": ["auth_sub"],
|
|
54
|
+
"nameExplicit": false,
|
|
55
|
+
"name": "users_pkey",
|
|
56
|
+
"schema": "public",
|
|
57
|
+
"table": "users",
|
|
58
|
+
"entityType": "pks"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"renames": []
|
|
62
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2",
|
|
3
|
+
"dialect": "mssql",
|
|
4
|
+
"id": "425df2f4-c774-4d68-870e-936662d9c250",
|
|
5
|
+
"prevIds": ["00000000-0000-0000-0000-000000000000"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"name": "count_history",
|
|
9
|
+
"entityType": "tables",
|
|
10
|
+
"schema": "dbo"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "int",
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"generated": null,
|
|
16
|
+
"identity": {
|
|
17
|
+
"seed": 1,
|
|
18
|
+
"increment": 1
|
|
19
|
+
},
|
|
20
|
+
"name": "uid",
|
|
21
|
+
"schema": "dbo",
|
|
22
|
+
"entityType": "columns",
|
|
23
|
+
"table": "count_history"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "int",
|
|
27
|
+
"notNull": true,
|
|
28
|
+
"generated": null,
|
|
29
|
+
"identity": null,
|
|
30
|
+
"name": "count",
|
|
31
|
+
"schema": "dbo",
|
|
32
|
+
"entityType": "columns",
|
|
33
|
+
"table": "count_history"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "datetime2",
|
|
37
|
+
"notNull": true,
|
|
38
|
+
"generated": null,
|
|
39
|
+
"identity": null,
|
|
40
|
+
"name": "created_at",
|
|
41
|
+
"schema": "dbo",
|
|
42
|
+
"entityType": "columns",
|
|
43
|
+
"table": "count_history"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"nameExplicit": false,
|
|
47
|
+
"columns": ["uid"],
|
|
48
|
+
"name": "count_history_pkey",
|
|
49
|
+
"table": "count_history",
|
|
50
|
+
"schema": "dbo",
|
|
51
|
+
"entityType": "pks"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"column": "created_at",
|
|
55
|
+
"nameExplicit": false,
|
|
56
|
+
"default": "(sysdatetime())",
|
|
57
|
+
"name": "count_history_created_at_default",
|
|
58
|
+
"entityType": "defaults",
|
|
59
|
+
"schema": "dbo",
|
|
60
|
+
"table": "count_history"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"renames": []
|
|
64
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
CREATE TABLE [users] (
|
|
2
|
+
[auth_sub] nvarchar(255),
|
|
3
|
+
[created_at] datetime2 NOT NULL CONSTRAINT [users_created_at_default] DEFAULT (sysdatetime()),
|
|
4
|
+
[metadata] nvarchar(max) CONSTRAINT [users_metadata_default] DEFAULT ('{}'),
|
|
5
|
+
CONSTRAINT [users_pkey] PRIMARY KEY([auth_sub])
|
|
6
|
+
);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2",
|
|
3
|
+
"dialect": "mssql",
|
|
4
|
+
"id": "c491f825-d719-4383-8371-1d24485e8ddb",
|
|
5
|
+
"prevIds": ["00000000-0000-0000-0000-000000000000"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"name": "users",
|
|
9
|
+
"entityType": "tables",
|
|
10
|
+
"schema": "dbo"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "nvarchar(255)",
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"generated": null,
|
|
16
|
+
"identity": null,
|
|
17
|
+
"name": "auth_sub",
|
|
18
|
+
"schema": "dbo",
|
|
19
|
+
"entityType": "columns",
|
|
20
|
+
"table": "users"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "datetime2",
|
|
24
|
+
"notNull": true,
|
|
25
|
+
"generated": null,
|
|
26
|
+
"identity": null,
|
|
27
|
+
"name": "created_at",
|
|
28
|
+
"schema": "dbo",
|
|
29
|
+
"entityType": "columns",
|
|
30
|
+
"table": "users"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "nvarchar(max)",
|
|
34
|
+
"notNull": false,
|
|
35
|
+
"generated": null,
|
|
36
|
+
"identity": null,
|
|
37
|
+
"name": "metadata",
|
|
38
|
+
"schema": "dbo",
|
|
39
|
+
"entityType": "columns",
|
|
40
|
+
"table": "users"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"nameExplicit": false,
|
|
44
|
+
"columns": ["auth_sub"],
|
|
45
|
+
"name": "users_pkey",
|
|
46
|
+
"table": "users",
|
|
47
|
+
"schema": "dbo",
|
|
48
|
+
"entityType": "pks"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"column": "created_at",
|
|
52
|
+
"nameExplicit": false,
|
|
53
|
+
"default": "(sysdatetime())",
|
|
54
|
+
"name": "users_created_at_default",
|
|
55
|
+
"entityType": "defaults",
|
|
56
|
+
"schema": "dbo",
|
|
57
|
+
"table": "users"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"column": "metadata",
|
|
61
|
+
"nameExplicit": false,
|
|
62
|
+
"default": "('{}')",
|
|
63
|
+
"name": "users_metadata_default",
|
|
64
|
+
"entityType": "defaults",
|
|
65
|
+
"schema": "dbo",
|
|
66
|
+
"table": "users"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"renames": []
|
|
70
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "mysql",
|
|
4
|
+
"id": "658c0ebf-8885-4a5b-80a8-198504da6d23",
|
|
5
|
+
"prevIds": ["00000000-0000-0000-0000-000000000000"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"name": "count_history",
|
|
9
|
+
"entityType": "tables"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "int",
|
|
13
|
+
"notNull": true,
|
|
14
|
+
"autoIncrement": true,
|
|
15
|
+
"default": null,
|
|
16
|
+
"onUpdateNow": false,
|
|
17
|
+
"onUpdateNowFsp": null,
|
|
18
|
+
"charSet": null,
|
|
19
|
+
"collation": null,
|
|
20
|
+
"generated": null,
|
|
21
|
+
"name": "uid",
|
|
22
|
+
"entityType": "columns",
|
|
23
|
+
"table": "count_history"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "int",
|
|
27
|
+
"notNull": true,
|
|
28
|
+
"autoIncrement": false,
|
|
29
|
+
"default": null,
|
|
30
|
+
"onUpdateNow": false,
|
|
31
|
+
"onUpdateNowFsp": null,
|
|
32
|
+
"charSet": null,
|
|
33
|
+
"collation": null,
|
|
34
|
+
"generated": null,
|
|
35
|
+
"name": "count",
|
|
36
|
+
"entityType": "columns",
|
|
37
|
+
"table": "count_history"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "timestamp",
|
|
41
|
+
"notNull": true,
|
|
42
|
+
"autoIncrement": false,
|
|
43
|
+
"default": "(now())",
|
|
44
|
+
"onUpdateNow": false,
|
|
45
|
+
"onUpdateNowFsp": null,
|
|
46
|
+
"charSet": null,
|
|
47
|
+
"collation": null,
|
|
48
|
+
"generated": null,
|
|
49
|
+
"name": "created_at",
|
|
50
|
+
"entityType": "columns",
|
|
51
|
+
"table": "count_history"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"columns": ["uid"],
|
|
55
|
+
"name": "PRIMARY",
|
|
56
|
+
"table": "count_history",
|
|
57
|
+
"entityType": "pks"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"renames": []
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "mysql",
|
|
4
|
+
"id": "74e2d582-26d7-4879-aff9-8f2c140b5eab",
|
|
5
|
+
"prevIds": ["00000000-0000-0000-0000-000000000000"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"name": "users",
|
|
9
|
+
"entityType": "tables"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "varchar(255)",
|
|
13
|
+
"notNull": true,
|
|
14
|
+
"autoIncrement": false,
|
|
15
|
+
"default": null,
|
|
16
|
+
"onUpdateNow": false,
|
|
17
|
+
"onUpdateNowFsp": null,
|
|
18
|
+
"charSet": null,
|
|
19
|
+
"collation": null,
|
|
20
|
+
"generated": null,
|
|
21
|
+
"name": "auth_sub",
|
|
22
|
+
"entityType": "columns",
|
|
23
|
+
"table": "users"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "timestamp",
|
|
27
|
+
"notNull": true,
|
|
28
|
+
"autoIncrement": false,
|
|
29
|
+
"default": "(now())",
|
|
30
|
+
"onUpdateNow": false,
|
|
31
|
+
"onUpdateNowFsp": null,
|
|
32
|
+
"charSet": null,
|
|
33
|
+
"collation": null,
|
|
34
|
+
"generated": null,
|
|
35
|
+
"name": "created_at",
|
|
36
|
+
"entityType": "columns",
|
|
37
|
+
"table": "users"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "json",
|
|
41
|
+
"notNull": false,
|
|
42
|
+
"autoIncrement": false,
|
|
43
|
+
"default": "('{}')",
|
|
44
|
+
"onUpdateNow": false,
|
|
45
|
+
"onUpdateNowFsp": null,
|
|
46
|
+
"charSet": null,
|
|
47
|
+
"collation": null,
|
|
48
|
+
"generated": null,
|
|
49
|
+
"name": "metadata",
|
|
50
|
+
"entityType": "columns",
|
|
51
|
+
"table": "users"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"columns": ["auth_sub"],
|
|
55
|
+
"name": "PRIMARY",
|
|
56
|
+
"table": "users",
|
|
57
|
+
"entityType": "pks"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"renames": []
|
|
61
|
+
}
|
package/dist/templates/db/migrations/postgresql-count-history/20260926210320_init/migration.sql
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
CREATE TABLE "count_history" (
|
|
2
|
+
"uid" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "count_history_uid_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
|
3
|
+
"count" integer NOT NULL,
|
|
4
|
+
"created_at" timestamp DEFAULT now() NOT NULL
|
|
5
|
+
);
|