Skip to content

Commit

Permalink
feat(darekf77/tnp#21): migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Dec 29, 2024
1 parent d2ee8d6 commit 362a415
Show file tree
Hide file tree
Showing 77 changed files with 2,710 additions and 309 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ Thumbs.db


/.vscode/launch.json
/*.sqlite
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"ms-vscode-remote.remote-ssh",
"tomoki1207.pdf",
"hediet.vscode-drawio",
"antfu.file-nesting"
"christian-kohler.path-intellisense",
"thebearingedge.vscode-sql-lit"
]
}
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"**/recent.json": true,
"**/angular.json": true,
"**/webpack*": true,
"**/docs/**/*": true,
"**/run-*": true,
"**/run.*": true,
"**/package-lock.json": true,
Expand All @@ -77,7 +76,6 @@
"eslint.enable": true,
"tslint.enable": false,
"search.exclude": {
"docs": true,
"bin": true,
"local_release": true,
"node_modules": true,
Expand All @@ -89,7 +87,6 @@
".firedev": true,
".taon": true,
".tnp": true,
"**/docs": true,
"**/bin": true,
"**/local_release": true,
"**/node_modules": true,
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
- ✅ standalone projects support (app + lib)
- ✅ organization projects support
- ✅ stable isomorphic library build
-realese app to github /docs
-release app to github /docs
- ✅ websql mode for mocked backend in github /docs

6 changes: 3 additions & 3 deletions docs-app-build-config.json5
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file is generated by command: firedev release
// With this configuration you can use: firedev automatic:release:docs
// This file is generated by command: taon release
// With this configuration you can use: taon automatic:release:docs
{
build: true,
prod: false,
websql: false,
projName: 'firedev',
projName: 'taon',
}
11 changes: 11 additions & 0 deletions docs/SQL-BEST-PRACTISES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SQL - best practices


## Use CURRENT_TIMESTAMP instead NOW()

![alt text](image.png)


## Use integer instead int

sqlite does not support it
Binary file added docs/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions docs/migrations.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<mxfile host="65bd71144e">
<diagram id="hX58gXemlc1ROdKSPT1T" name="Page-1">
<mxGraphModel dx="793" dy="508" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="23" value="Migrations" style="shape=table;startSize=30;container=1;collapsible=0;childLayout=tableLayout;fontStyle=1;align=center;gradientColor=none;" parent="1" vertex="1">
<mxGeometry x="60" width="620" height="360" as="geometry"/>
</mxCell>
<mxCell id="24" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="23" vertex="1">
<mxGeometry y="30" width="620" height="49" as="geometry"/>
</mxCell>
<mxCell id="25" value="" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="24" vertex="1">
<mxGeometry width="207" height="49" as="geometry">
<mxRectangle width="207" height="49" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="26" value="Normal mode" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="24" vertex="1">
<mxGeometry x="207" width="206" height="49" as="geometry">
<mxRectangle width="206" height="49" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="27" value="Websql Mode&lt;br&gt;" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="24" vertex="1">
<mxGeometry x="413" width="207" height="49" as="geometry">
<mxRectangle width="207" height="49" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="28" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="23" vertex="1">
<mxGeometry y="79" width="620" height="141" as="geometry"/>
</mxCell>
<mxCell id="29" value="&lt;div style=&quot;background-color: rgb(255, 255, 255); font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18px;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;DROP_DB+MIGRATIONS&lt;/span&gt;&lt;/div&gt;" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="28" vertex="1">
<mxGeometry width="207" height="141" as="geometry">
<mxRectangle width="207" height="141" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="30" value="- recrate db and all entites&lt;br&gt;- do not preserve data&lt;br&gt;- do not run migrations&lt;br&gt;- persists default entities" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="28" vertex="1">
<mxGeometry x="207" width="206" height="141" as="geometry">
<mxRectangle width="206" height="141" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="31" value="- recrate db and all entites&lt;br style=&quot;border-color: var(--border-color);&quot;&gt;- do not preserve data&lt;br style=&quot;border-color: var(--border-color);&quot;&gt;- do not run migrations&lt;br style=&quot;border-color: var(--border-color);&quot;&gt;- persists default entities&lt;br&gt;RELOAD WILL DROP DB" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="28" vertex="1">
<mxGeometry x="413" width="207" height="141" as="geometry">
<mxRectangle width="207" height="141" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="32" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="23" vertex="1">
<mxGeometry y="220" width="620" height="140" as="geometry"/>
</mxCell>
<mxCell id="33" value="&lt;div style=&quot;background-color: rgb(255, 255, 255); font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18px;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;PRESERVE_DATA+MIGRATIONS&lt;/span&gt;&lt;/div&gt;" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="32" vertex="1">
<mxGeometry width="207" height="140" as="geometry">
<mxRectangle width="207" height="140" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="34" value="- preserve data&lt;br&gt;- run migrations&lt;br&gt;- persits default entities" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="32" vertex="1">
<mxGeometry x="207" width="206" height="140" as="geometry">
<mxRectangle width="206" height="140" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="35" value="- preserve data&lt;br style=&quot;border-color: var(--border-color);&quot;&gt;- run migrations&lt;br&gt;(WHEN SWITCHING FIRST TIME &lt;br&gt;IT WILL MARKA ALL MIGRATION AS COMPLETED)&lt;br style=&quot;border-color: var(--border-color);&quot;&gt;- persits default entities&lt;br&gt;RELOAD WILL PRESERVE DATA" style="shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;" parent="32" vertex="1">
<mxGeometry x="413" width="207" height="140" as="geometry">
<mxRectangle width="207" height="140" as="alternateBounds"/>
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@
"sloc": "0.2.0",
"socket.io-client": "4.7.5",
"sort-package-json": "1.11.0",
"sql-template-strings": "2.2.2",
"sql-template-tag": "5.2.1",
"sql.js": "1.8.0",
"static-columns": "~18.0.16",
"string-similarity": "4.0.4",
Expand Down
3 changes: 2 additions & 1 deletion projects/container-v18/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"ms-vscode-remote.remote-ssh",
"tomoki1207.pdf",
"hediet.vscode-drawio",
"antfu.file-nesting"
"antfu.file-nesting",
"thebearingedge.vscode-sql-lit"
]
}
2 changes: 0 additions & 2 deletions projects/container-v18/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"typescript.tsdk": "node_modules/typescript/lib",
"files.exclude": {},
"search.exclude": {
"docs": true,
"bin": true,
"local_release": true,
"node_modules": true,
Expand All @@ -24,7 +23,6 @@
".firedev": true,
".taon": true,
".tnp": true,
"**/docs": true,
"**/bin": true,
"**/local_release": true,
"**/node_modules": true,
Expand Down
3 changes: 2 additions & 1 deletion projects/container-v18/examples-v18/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"ms-vscode-remote.remote-ssh",
"tomoki1207.pdf",
"hediet.vscode-drawio",
"antfu.file-nesting"
"antfu.file-nesting",
"thebearingedge.vscode-sql-lit"
]
}
8 changes: 3 additions & 5 deletions projects/container-v18/examples-v18/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"**/node_modules": true,
"**/tmp*": true,
"**/dist*": true,
"**/bundle*": true,
"**/browser": true,
"**/browser*": true,
"**/websql": true,
"**/websql*": true,
"**/module*": true,
Expand Down Expand Up @@ -38,13 +36,15 @@
"**/recent.json": true,
"**/angular.json": true,
"**/webpack*": true,
"**/docs/**/*": true,
"**/run-*": true,
"**/run.*": true,
"**/package-lock.json": true,
"**/protractor.conf.js": true,
"**/karma.conf.js": true,
"**/docs-config.schema.json": true,
"**/index.js": true,
"**/index.d.ts": true,
"**/index.js.map": true,
"recent.json": true,
"angular.json": true
},
Expand All @@ -61,7 +61,6 @@
"tslint.autoFixOnSave": true,
"tslint.enable": true,
"search.exclude": {
"docs": true,
"bin": true,
"local_release": true,
"node_modules": true,
Expand All @@ -73,7 +72,6 @@
".firedev": true,
".taon": true,
".tnp": true,
"**/docs": true,
"**/bin": true,
"**/local_release": true,
"**/node_modules": true,
Expand Down
8 changes: 8 additions & 0 deletions projects/container-v18/examples-v18/linked-projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
deafultBranch: "master",
relativeClonePath: "subscriber-inject",
repoUrl: "https://github.com/darekf77/subscriber-inject.git",
}, {
deafultBranch: "master",
relativeClonePath: "migration",
repoUrl: "[email protected]:darekf77/migration.git",
}, {
deafultBranch: "master",
relativeClonePath: "sample-migration",
repoUrl: "[email protected]:darekf77/sample-migration.git",
}]
}
Loading

0 comments on commit 362a415

Please sign in to comment.