@nathapp/na-cli 1.0.0-rc.16 → 1.0.0-rc.17
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/.npm/_cacache/index-v5/05/34/1929926becc54c1f69c0921ab74c461c1777ab3d43213900acd4779dbf27 +1 -1
- package/.npm/_cacache/index-v5/0b/57/19385728919a097d1777ef98285f6cdfca14b66511276b641ec4a3af64bc +1 -1
- package/.npm/_cacache/index-v5/0b/90/c147816be94e86ed9bbb4b9e20409e4791a8991fcfd41d7a44489dedd29b +1 -1
- package/.npm/_cacache/index-v5/0b/ac/1bc19a224468b5a9e4382b946d33bb4c236306c2cefe190e5e2db1ded98a +1 -1
- package/.npm/_cacache/index-v5/12/6d/f094b1c476935fbda8814b43ee001b439b1f793c265ee5bd97d566143fb4 +1 -1
- package/.npm/_cacache/index-v5/12/80/c192e66daf6ba49f528ae81b986857735e6d257bdf4b0b1758eb795cae9b +1 -1
- package/.npm/_cacache/index-v5/13/32/a5865acd35ae515cde972c2d6cbff2863e694975883870de78b62a80f30e +1 -1
- package/.npm/_cacache/index-v5/14/33/be443b6e6c3ef0ff8f09987bc62d5ef9e61259f3331c422182f6bb74fdeb +1 -1
- package/.npm/_cacache/index-v5/14/f7/87042931e5944467d47331c350feb4384bf9143ab6ceebf7108a55905843 +1 -1
- package/.npm/_cacache/index-v5/14/fa/f87baceab26935686548c742091e7014930673bc1f077574c54c4c6c2d2d +1 -1
- package/.npm/_cacache/index-v5/15/26/abf1072208668be6e34a4311ad25f34fc908c21abc17ef01b5836cef1879 +1 -1
- package/.npm/_cacache/index-v5/1a/fd/532a4c7bf52c908d567ded2bb11b0f3282f0733d0d079a5291c2f72e0077 +1 -1
- package/.npm/_cacache/index-v5/1b/15/2ed036cc76081b7f1bfb3aa59d491eb3b3602c9381ec8d81435ceecf56b5 +1 -1
- package/.npm/_cacache/index-v5/27/b7/7f36d855e73b72c900bef7ba44a2a553de3d77b218493b4ddb6ae6fce516 +1 -1
- package/.npm/_cacache/index-v5/27/cc/afd4aa090b087c509f17e75196209f498c916da50ee4e9f26bd8424fd6f7 +1 -1
- package/.npm/_cacache/index-v5/2d/80/b5e9ca2e40744e7fa089861626d2a29c62363c01729964f4cf0c3e8ee632 +1 -1
- package/.npm/_cacache/index-v5/2d/ed/7f785cb92982f557fdc81aec4081952ce428eb449dd91fa0867b6676fa17 +1 -1
- package/.npm/_cacache/index-v5/2e/30/64338ba8469bd5c48ab7843f9d06a83992a346cfd592194af9c6d4d6dc48 +1 -1
- package/.npm/_cacache/index-v5/2e/a8/503d5f11e5dcde5786e3973ff160d2acc4736af22f9cd5a883c26adc7824 +1 -1
- package/.npm/_cacache/index-v5/30/98/41b0d8db0052e964e4843260ec8a0b12f2541721317cd5ee90b07b6a4d59 +1 -1
- package/.npm/_cacache/index-v5/31/64/15cefe5f3b923ebb9c684b37db7451ccf335632aab377fa3c730ec2e79cd +1 -1
- package/.npm/_cacache/index-v5/31/ac/4d241faeb3fea9ec8318fd93dd55eb70a87cc8a6e3f849ccef9863882b4b +3 -3
- package/.npm/_cacache/index-v5/31/ca/a8c3ab0670811a3887ede187dcd3856d14272349a18f6844f7c8007cc05e +1 -1
- package/.npm/_cacache/index-v5/34/a0/f70f68dcf9baef2ff21f29fdd206513fe5b10736be36ddd2f65a654a8f23 +1 -1
- package/.npm/_cacache/index-v5/34/f7/8879c3cd1412a0890461590276aa13d0344cb4e09494a4b3d854a7c7660a +1 -1
- package/.npm/_cacache/index-v5/35/e5/adb97753b463aa67dc9f26f39e8a52f68bf467cf1187509be7da174c057d +1 -1
- package/.npm/_cacache/index-v5/37/53/b5dccfb634beb6de718b268b6434849f27d3cf60d426dc19472a642a3f01 +1 -1
- package/.npm/_cacache/index-v5/38/2e/fe53691fa43d2f5ac447c8a2431535ec49118be55bf483c6362d4f72c79b +1 -1
- package/.npm/_cacache/index-v5/3c/f6/26a7f7dccb969c764b8bdecb3667023c64bc1159e674fbeeca633c54964c +1 -1
- package/.npm/_cacache/index-v5/3d/dd/3e8c6b6c875addf2057fb5fa152fff0fab217f78a8e51c0aa457a925bf12 +1 -1
- package/.npm/_cacache/index-v5/3e/77/916dd3c99bb6e83a0217305b0a2a541f122d977edcb92fa6b58eed796c17 +1 -1
- package/.npm/_cacache/index-v5/40/62/d04e75208dec117f72a95a5989f81fac7565a530fd22f70ea5e3abc377c3 +2 -2
- package/.npm/_cacache/index-v5/42/89/e110619623b1c9111a6392de4b1a62a904fb08d0601f87b9c8e1d493f5d6 +1 -1
- package/.npm/_cacache/index-v5/46/5b/f3ce50d3f54a5d65ac316d3c71ef8a8f8bdb072b6dfabc2c69018c3e942a +1 -1
- package/.npm/_cacache/index-v5/48/17/0ecf04bc0839b23c609ec7bfea9d339fa2cc3ee5982716cf7465ffaea675 +1 -1
- package/.npm/_cacache/index-v5/53/aa/b41f4759346e1d3b6651322d78c7983a4a546cdd6c18c3eb56c944571e4b +1 -1
- package/.npm/_cacache/index-v5/57/4d/cdafdfd03e43ca95652cbbb0b23bbbbeef3e16fa307726cb2ae8a5658531 +1 -1
- package/.npm/_cacache/index-v5/58/c9/9f8c27572bf3034e8fa9cc74fc00878e45fa7d75d4570d4430e82bfb5ef3 +1 -1
- package/.npm/_cacache/index-v5/5a/8c/47e273da29b52c911f59eca44c62faa84be4bb59b1de259ba100ff968559 +1 -1
- package/.npm/_cacache/index-v5/5e/89/be4afbbaa5c56c070a74790be14bd112b9e1b3f251324d766264b2c5f880 +1 -1
- package/.npm/_cacache/index-v5/5e/e7/453bd89145eccf9d67f5797fb09e5a017b5b13f1ac45cb7b70bda45940ec +2 -2
- package/.npm/_cacache/index-v5/5f/57/67c3b0c63ea4198903509c050bb99de2eabd6a2fba583067c4f587dc25f7 +1 -1
- package/.npm/_cacache/index-v5/60/8c/b74a2ae1c6978d635a1a21438c553d956a762176742b2749d09db964bf4d +1 -1
- package/.npm/_cacache/index-v5/68/6b/1f834b2ea43c7a9d1ffd80eb09f9d44af0895dc31dc3955d4b4c797ea825 +1 -1
- package/.npm/_cacache/index-v5/6d/61/c9e7e8446341cea439547eb023fbf47c954ba932e6944a3fd50413c1e861 +1 -1
- package/.npm/_cacache/index-v5/6d/b3/82949bd186224f1f51cb3fabdad6a93aa6a64c685b395a36f0a34af15119 +1 -1
- package/.npm/_cacache/index-v5/6f/d8/170c71ac7185da1b8040f10243c7294ff9a667a27fffc3479ba2f222f014 +1 -1
- package/.npm/_cacache/index-v5/74/d3/f9a4984e5548c5f72b3dc858046781cc3a892b34b6b7e7c353fbc93aa060 +1 -1
- package/.npm/_cacache/index-v5/75/ec/5dd4c902abf3f9ae589620cd4fd5b6ccfe045b8abdfbfa050d1a5ba8c01e +1 -1
- package/.npm/_cacache/index-v5/77/be/4d3f23909fd5905444d34cb0ce78d5bf6ce157670ae6ed614389a2027d18 +1 -1
- package/.npm/_cacache/index-v5/7d/8f/423d7e791f7fedd6bef784f0f467761c619f209ce9c788f08b63e968a880 +1 -1
- package/.npm/_cacache/index-v5/80/da/c34ca077ec2051cad25b3313e4e75ff4ad2dc2b12a9c250cb9545c0adc4b +1 -1
- package/.npm/_cacache/index-v5/84/d7/a5acf52705a1beb66603196f4bc44e583052d0f1d5a23dfb5316da1811d3 +1 -1
- package/.npm/_cacache/index-v5/86/7a/c59a43ec4985d34346e5714968f7220d176ea3a61b55464a7fecae01ac47 +1 -1
- package/.npm/_cacache/index-v5/87/55/e56d34b37c3170079064597cabb288d076b0d0468eaba3b8a0cf8686ce1f +1 -1
- package/.npm/_cacache/index-v5/8a/c9/c10bf71d66461aba0899e81d7a146332c45dbbacb1693c38fc2e4e578e39 +3 -3
- package/.npm/_cacache/index-v5/8a/ee/e3e86b627c10a9fc4ed610c15792507293ba1c14e7ba839e22aec609f1e0 +1 -1
- package/.npm/_cacache/index-v5/8b/ee/c2ea22c4bf9c5ddcd0333850e543442de3364478847c7ebc382b1ff3a70d +2 -2
- package/.npm/_cacache/index-v5/8c/2d/fc95c0f3896963b4fe4b745b6d2bbc04a2a75f31f108ff740215559617f0 +1 -1
- package/.npm/_cacache/index-v5/8e/95/715914a073e3319f22dfec7ffac9df9f293d150c0d6723a60ce08ab7f735 +1 -1
- package/.npm/_cacache/index-v5/91/73/ad583fa49e5575064791f28a81fa97fa62a4c7483b74960a58010efa1e77 +1 -1
- package/.npm/_cacache/index-v5/92/a4/7b5bd924b74993fc2b0de1a458842881545ca2cc22f6bc104a0db4fafdab +1 -1
- package/.npm/_cacache/index-v5/96/3a/a15f6c4dc3aeb3fd89c0b7a8c3ba58cb31a9b72c98e3b11a8ef1647b537f +1 -1
- package/.npm/_cacache/index-v5/96/b2/def9b882b950a49a7096d71afd5fce3a6a9454795fc060b1901e41d44620 +1 -1
- package/.npm/_cacache/index-v5/98/64/01faddae5e2bf199c5f8953942897841c5634b1800e246226ea5489f4584 +1 -1
- package/.npm/_cacache/index-v5/99/a9/8e746181ef13bc400da207da412881206f4d2004d75453373f6ee7b25ffa +1 -1
- package/.npm/_cacache/index-v5/9a/fc/baddd71f459a50b3c710a007fa7d59fa62febef98033b7331374bf02db64 +1 -1
- package/.npm/_cacache/index-v5/9b/55/1bc87872916d09156d5c7056d7ac2b245e7a7638b817eb3dbeafa9d33be8 +1 -1
- package/.npm/_cacache/index-v5/9b/b8/d45062af43674e433f967d20768d308ed6ce195be6acadfb7cfd21d11e67 +1 -1
- package/.npm/_cacache/index-v5/9c/0e/3faaf557a9613fb7f09b5cecc63ebe78da10371a1f2f58b636f8dcb9a914 +1 -1
- package/.npm/_cacache/index-v5/9c/b1/fff150691ce095677426e98bb894621ce4a88097d4b2c5c342224e1852ae +1 -1
- package/.npm/_cacache/index-v5/9d/6b/339b9832e323abb280eb874ec64f59486423026430be7b1c2ec42ca7e1b7 +1 -1
- package/.npm/_cacache/index-v5/9d/eb/0927bbd589e18b447a3726f591019d6728da728f603e77a1ded3f78dc6eb +1 -1
- package/.npm/_cacache/index-v5/9f/43/3636172cbc03abf2262c921f9f71572e6b049aa3db8c65d166bcfe5aca5f +1 -1
- package/.npm/_cacache/index-v5/a0/9e/5b7b95cdee86846e4fbe92c9e16e0e7f337c77d2c12de9778522b15bed2e +1 -1
- package/.npm/_cacache/index-v5/a1/ff/6532bc014331c9b572482a4bd805bf54a7ff8b4ca179b1c811aff3dec690 +1 -1
- package/.npm/_cacache/index-v5/a7/11/13f3c5864a7e9d12ca50a19b99d77d88fbcebb1ceb7455eb7ff77f158b64 +1 -1
- package/.npm/_cacache/index-v5/aa/9b/8b6d9e0f45dde1c6af2a4fc211f9b3a74f14041dc04a8a20490a478660b2 +1 -1
- package/.npm/_cacache/index-v5/aa/c4/489c0e6a9e4cbd64a8acd4fbfda113e9dfdd114f464830471fda53fff0cd +1 -1
- package/.npm/_cacache/index-v5/ab/47/d7a88d46cb8996b726bc7ed9280b5eea26889ab7c848149032a6e8911e4b +1 -1
- package/.npm/_cacache/index-v5/ac/4c/71e880f5d5c742e0e3807e7f3c398e920dd019bbf723586f0a7342715580 +1 -1
- package/.npm/_cacache/index-v5/ac/86/c0732592365d753d382502d91754a3c88f8b20e22cc25a0327beb9429687 +1 -1
- package/.npm/_cacache/index-v5/b0/9b/1a1d76c3ad82dd54353bb8ac8397667df4c5db97e42abf0de3fab68065bb +1 -1
- package/.npm/_cacache/index-v5/b3/b3/05a8af0a671c32b41850c1223429fe74449cfcb4c7cac54a9c7c213dfcae +3 -3
- package/.npm/_cacache/index-v5/b3/ba/fbf7da5c8eb06d9cc72143e3d36d7f701447b4e0a221c40d4960e06c7296 +1 -1
- package/.npm/_cacache/index-v5/b5/5f/1a200e91b7580c5893016e1b1397b6a076ff51cc7c5d382c3b1f1e52edd5 +1 -1
- package/.npm/_cacache/index-v5/b6/a8/3bf06da815e92239da2bd4ef7322819b458ee23ae8db9f02dc9a3dca722f +1 -1
- package/.npm/_cacache/index-v5/b7/38/992d3e6c01fc9098d137f7dbccfcaa5f5124ba9c487e582e6e0d83f99d30 +1 -1
- package/.npm/_cacache/index-v5/b7/d6/b5986a5f5d44d726090a94a22a8dff7a7c391df4a4fa4862bb50b1da196b +1 -1
- package/.npm/_cacache/index-v5/ba/d5/f7d95a8e3571758f8b5d095a21909a8f6cdfe7fd2349f7f72b2801eef079 +1 -1
- package/.npm/_cacache/index-v5/bb/8a/9c0052bb21f628e48a1e8d25084ee4adb402eba28c747d0299ebf4c3185d +1 -1
- package/.npm/_cacache/index-v5/be/a3/c0779c8e0be92c748c91a7dad4e6f0fe57ba0158b6bb1bcfddd8fc56c934 +1 -1
- package/.npm/_cacache/index-v5/be/c2/aa68eca6cebd477430ae24727732ec08ee9fc9ef2482df77932eb2f413d9 +1 -1
- package/.npm/_cacache/index-v5/bf/7c/375aec77f76404d91225e72006a0105b2a6ec04bb02cfa365ebcd4a0232b +1 -1
- package/.npm/_cacache/index-v5/c0/15/8b360dbe06b62052f2a43702140af0bca66e2e4064d7d2016efb4a2a149a +1 -1
- package/.npm/_cacache/index-v5/c2/a4/488f71f39bc65742422faf2c74e3b330852ef2192dbb3198fed044e60c20 +1 -1
- package/.npm/_cacache/index-v5/c4/89/38b2ab5b89326ead12dbed7a2076caa44d1207dd6cdb3f9f93273843dcf5 +1 -1
- package/.npm/_cacache/index-v5/c4/ac/4511be3eecea50ee9cadc09a612f9be8598d7b29d5c8b1253c75fa283cc5 +1 -1
- package/.npm/_cacache/index-v5/c5/2d/90031096314e15f4fcc35c804c2180f88214a7851b531aa27bd64064f740 +1 -1
- package/.npm/_cacache/index-v5/c7/5e/2acc90bb8fd9d3150354ec8b2f7e7cc2c8e0e59efd575a1963f1ca66cbed +1 -1
- package/.npm/_cacache/index-v5/c9/f5/c4a24d8834c4e9523cc24e10c6db63876e3eecdb2cf33762b159e3a1e92f +1 -1
- package/.npm/_cacache/index-v5/cc/2d/3cc1e00b73d00c921b8f8c92faaae480a160fc63637ba7b098518db79e02 +1 -1
- package/.npm/_cacache/index-v5/cf/56/427919eefb09afe942b12902069325293191afa7d59ff0f2b016c402b4ec +1 -1
- package/.npm/_cacache/index-v5/d1/86/f4ec8df7e9b3ceb2ae6c610f3231b693689e2ce78bd03413adef8d029a63 +1 -1
- package/.npm/_cacache/index-v5/d3/ba/564670f99cd2d757d1ac6209834faf1ce9a94ed856243cf090249d9b2b38 +1 -1
- package/.npm/_cacache/index-v5/d5/f4/0913a74f5e223a4fe6108493dd3b03c2d47259df459926160659513c9ad3 +1 -1
- package/.npm/_cacache/index-v5/dd/03/456ce7d8bffee20c3acf7e18ef6501b637d59a6fa3fa7bac5ed160b6be3f +1 -1
- package/.npm/_cacache/index-v5/e3/6a/b90e45414a9e52cdf1e4a96698065357795b9400d7af079b0a75ee8fd76d +1 -1
- package/.npm/_cacache/index-v5/e7/16/c0952e37a6a02b506441a59ee6b0e7fa873a515247763df9dddd162bbcf0 +1 -1
- package/.npm/_cacache/index-v5/e8/50/601e38974398787a5a8a8b8d835e29447814cd68ff6fe2e9629738e124c6 +1 -1
- package/.npm/_cacache/index-v5/ee/47/02714e9e61ca394444a92772fe85340de8bd216b58f59e1af25d5618303f +1 -1
- package/.npm/_cacache/index-v5/ef/23/134a34866512795c8a5025d0b968f2e44b5be8ab3a05b400c089c32a272e +1 -1
- package/.npm/_cacache/index-v5/ef/74/026f830458505ca7ae44dac678900360af24ed6e76521eb12df5fadcf26f +1 -1
- package/.npm/_cacache/index-v5/f1/75/91238e32e2ac4d9c4976deec39a2e6ca85c0c678a4466a50ca4412272a7c +1 -1
- package/.npm/_cacache/index-v5/f2/1f/c662626ec8eafafa54476678b9f71799a74ee368f2b7845a6ec9f9174a4d +3 -3
- package/.npm/_cacache/index-v5/f5/a4/ca599571c5bcfc5351ca53c418a6cd9d162539528b1ed87a692a1677020e +1 -1
- package/.npm/_cacache/index-v5/f6/18/16e565c66306149a0b31bb2af01babb55bd65ef7cb85a8a11d486d933b60 +1 -1
- package/.npm/_cacache/index-v5/f8/f5/f04b833fa130e113a9093088ad108d8cf9b2b1d5a0336e48cbf0916b8686 +1 -1
- package/.npm/_cacache/index-v5/fa/88/31cbd6ca584e75edf3642c6f8b079c1f2b5eca1d7b2780ce2e86c24f1e84 +1 -1
- package/.npm/_cacache/index-v5/fb/ae/46c38299837b3b4dcee9dc45854a6901355864326b4e64c730727ca1c88a +1 -1
- package/.npm/_cacache/index-v5/fc/1c/958fc085ebdc42fa37d4985cba976a5cca21f678c751c968f8fe9b259455 +1 -1
- package/.npm/_cacache/index-v5/fd/2e/6ead8880f4d02a536a570e21b13b4e7c9700082833e556cd53e9e92bfd1b +1 -1
- package/.npm/_cacache/index-v5/fd/46/fa56121e15b7f090f8050d0c954bbc9452e4c7ddde82777b2e00552c4220 +1 -1
- package/dist/templates/db-schema/001_Schema.sql +1 -0
- package/dist/templates/db-schema/910_DB_Grant_User.sql +0 -0
- package/dist/templates/db-schema/910_DB_Grant_User.sql.example +9 -0
- package/dist/templates/db-schema/990_SAMPLE_Init_Data.sql.example +27 -0
- package/dist/templates/db-schema/DEV_MODE.txt +1 -0
- package/dist/templates/db-schema/Dockerfile +3 -0
- package/dist/templates/db-schema/GET_VERSION.sql +47 -0
- package/dist/templates/db-schema/Makefile +885 -0
- package/dist/templates/db-schema/README.md +106 -0
- package/dist/templates/db-schema/SET_VERSION.sql +5 -0
- package/dist/templates/db-schema/docker-compose.yaml +47 -0
- package/dist/templates/db-schema/package.json +3 -0
- package/dist/templates/db-schema/push.sh +0 -0
- package/dist/utils/template.js +33 -5
- package/dist/utils/template.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/template.ts +23 -5
- package/templates/db-schema/001_Schema.sql +1 -0
- package/templates/db-schema/910_DB_Grant_User.sql +0 -0
- package/templates/db-schema/910_DB_Grant_User.sql.example +9 -0
- package/templates/db-schema/990_SAMPLE_Init_Data.sql.example +27 -0
- package/templates/db-schema/DEV_MODE.txt +1 -0
- package/templates/db-schema/Dockerfile +3 -0
- package/templates/db-schema/GET_VERSION.sql +47 -0
- package/templates/db-schema/Makefile +885 -0
- package/templates/db-schema/README.md +106 -0
- package/templates/db-schema/SET_VERSION.sql +5 -0
- package/templates/db-schema/docker-compose.yaml +47 -0
- package/templates/db-schema/package.json +3 -0
- package/templates/db-schema/push.sh +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# DB Schema Report
|
|
2
|
+
|
|
3
|
+
DB Schema For Development Environment
|
|
4
|
+
|
|
5
|
+
Project Code: X43
|
|
6
|
+
|
|
7
|
+
## File Naming Convention (Project Code: X43)
|
|
8
|
+
001 - Schema level
|
|
9
|
+
|
|
10
|
+
1XX - Table (auto generate from DEV_7XX)
|
|
11
|
+
|
|
12
|
+
3XX - Init data (auto generate from DEV_890)
|
|
13
|
+
|
|
14
|
+
5XX - Stored procedure (auto generate from DEV_8XX, except DEEV_890)
|
|
15
|
+
|
|
16
|
+
6XX - Migration
|
|
17
|
+
|
|
18
|
+
DEV_7XX - Version patch**
|
|
19
|
+
|
|
20
|
+
DEV_8XX - Release patch**
|
|
21
|
+
|
|
22
|
+
DEV_890 - Release patch init data**
|
|
23
|
+
|
|
24
|
+
DEV_899 - Release patch grant user account access**
|
|
25
|
+
|
|
26
|
+
910 - Grant user account access (auto generate from DEV_899)
|
|
27
|
+
|
|
28
|
+
990 - Generate init data for file 3XX
|
|
29
|
+
|
|
30
|
+
##### ** Maintain by developer
|
|
31
|
+
##### ** Note: During version release, The 7XX, 8XX files will be created and clear after version released.
|
|
32
|
+
##### ** If there is any new changes, developer should copy from the 3XX, 5XX, 910 files and rename it to DEV_8XX_*.sql
|
|
33
|
+
* File 3XX_*.sql --> DEV_890_*.sql
|
|
34
|
+
* File 5XX_*.sql --> DEV_8XX_*.sql
|
|
35
|
+
* File 910_*.sql --> DEV_899_*.sql
|
|
36
|
+
|
|
37
|
+
## Release Version
|
|
38
|
+
1. Create a release branch.
|
|
39
|
+
2. Remove the DEV_MODE.txt to enable release mode.
|
|
40
|
+
3. Developer will move the release content to new 7XX or 8XX files.
|
|
41
|
+
4. Once the content has been confirmed, run `make test` to ensure no syntax error.
|
|
42
|
+
5. Commit and create merge request to `master` branch.
|
|
43
|
+
6. On the `master` branch, run `make release` to generate the 1XX, 3XX, 5XX, and 910 files. It will generate init data for 300 files by 990 file execution.
|
|
44
|
+
7. Commit with commit message that contain `run-major-release`, `run-minor-release`, `run-patch-release`, or `run-release`. The `run-release` is an alias to `run-patch-release`.
|
|
45
|
+
|
|
46
|
+
## Create Version Tag
|
|
47
|
+
Write commit message that contain `run-tag`, a pre-release version tag will be created.
|
|
48
|
+
|
|
49
|
+
## View Full Script
|
|
50
|
+
`make view-init`
|
|
51
|
+
|
|
52
|
+
## View Patch Script
|
|
53
|
+
`make view-patch FROM=<version> TO=<version>`
|
|
54
|
+
|
|
55
|
+
## View Patch Script File
|
|
56
|
+
`make view-patch-file FROM=<version> TO=<version>`
|
|
57
|
+
|
|
58
|
+
## Lint & Test Locally
|
|
59
|
+
`make test`
|
|
60
|
+
|
|
61
|
+
##### ** In a development branch, the `DEV_MODE.txt` file should be created in order for the test process to use `DEV_7XX_*.sql` and `DEV_8XX_*.sql` files.
|
|
62
|
+
|
|
63
|
+
##### ** Prerequisite: `docker`, `docker-compose` & `jq` must be installed
|
|
64
|
+
|
|
65
|
+
## View All Version
|
|
66
|
+
`make versions`
|
|
67
|
+
|
|
68
|
+
## Generate release tables, stored procedures, init data, and grant permission files
|
|
69
|
+
`make release`
|
|
70
|
+
|
|
71
|
+
## Check duplicated stored procedure in 8XX file
|
|
72
|
+
`make dup`
|
|
73
|
+
|
|
74
|
+
## MYSQL console
|
|
75
|
+
`make cli`
|
|
76
|
+
|
|
77
|
+
## Initialization Process
|
|
78
|
+
Only range of files start with prefix (`001, 1XX, 3XX, 5XX, 6XX, 910`) will be include for the initialization process.
|
|
79
|
+
|
|
80
|
+
## Patch Process
|
|
81
|
+
Only range of files start with prefix (`7XX`, `8XX`) will be include for the patch process.
|
|
82
|
+
The `7XX` is a `version patch` file, it should reflect the changes from previous version. Basically for Table changes only. Please note, 7XX & 8XX files (except 890 & ) will be auto-deleted once version has been released.
|
|
83
|
+
The `8XX` is a `release patch` file, it should reflect the changes of current release. Basically for SP changes
|
|
84
|
+
The `890` is a init data file
|
|
85
|
+
The `899` is for grant database user permission command
|
|
86
|
+
|
|
87
|
+
## Developer work's
|
|
88
|
+
Tips: Easily lookup for your changes at any specific time range
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
SELECT db,name, created,modified,definer
|
|
92
|
+
FROM mysql.proc
|
|
93
|
+
WHERE db like 'sig_%'
|
|
94
|
+
AND definer = 'ali@%'
|
|
95
|
+
order by modified desc;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## RollBack Script
|
|
99
|
+
Developer need to prepare a RB script for each new or going to modify database object if automation deployment failed we are still able to restore to current state.
|
|
100
|
+
Developer need to set prefix for all the rollback file with prefix (`8xx_RB`) and (`7xx_RB`)
|
|
101
|
+
|
|
102
|
+
## Init Data Script
|
|
103
|
+
Init data script have to define with prefix (`890` or `990`)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
devbot chat: 13
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
version: '2.1'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
mysql:
|
|
5
|
+
logging:
|
|
6
|
+
driver: none
|
|
7
|
+
image: registry-intl.cn-hongkong.aliyuncs.com/wkns/mysql:5.7.31
|
|
8
|
+
expose:
|
|
9
|
+
- 3306
|
|
10
|
+
environment:
|
|
11
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
|
|
12
|
+
|
|
13
|
+
mysql8:
|
|
14
|
+
logging:
|
|
15
|
+
driver: none
|
|
16
|
+
image: registry-intl.cn-hongkong.aliyuncs.com/wkns/mysql:8
|
|
17
|
+
command: --default-authentication-plugin=mysql_native_password --log_bin_trust_function_creators=1
|
|
18
|
+
expose:
|
|
19
|
+
- 3306
|
|
20
|
+
environment:
|
|
21
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
|
|
22
|
+
|
|
23
|
+
init:
|
|
24
|
+
build:
|
|
25
|
+
context: .
|
|
26
|
+
image: test-init
|
|
27
|
+
command: make test-init
|
|
28
|
+
|
|
29
|
+
patch:
|
|
30
|
+
build:
|
|
31
|
+
context: .
|
|
32
|
+
image: test-patch
|
|
33
|
+
command: make test-patch
|
|
34
|
+
|
|
35
|
+
sync:
|
|
36
|
+
build:
|
|
37
|
+
context: .
|
|
38
|
+
image: sync
|
|
39
|
+
command: make run-sync
|
|
40
|
+
|
|
41
|
+
release:
|
|
42
|
+
build:
|
|
43
|
+
context: .
|
|
44
|
+
image: release
|
|
45
|
+
command: make run-release
|
|
46
|
+
volumes:
|
|
47
|
+
- ./:/out
|
|
File without changes
|
package/dist/utils/template.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -84,6 +95,19 @@ function generateTemplate(templateDir, targetDirectory) {
|
|
|
84
95
|
name: "run_install",
|
|
85
96
|
type: "confirm",
|
|
86
97
|
message: "Do you want to run npm install after template created?",
|
|
98
|
+
when: function (answer) {
|
|
99
|
+
var projectChoice = answer["template"];
|
|
100
|
+
return projectChoice !== "db-schema" || projectChoice !== "k8s-deployment";
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "db_master",
|
|
105
|
+
type: "input",
|
|
106
|
+
message: "what is the master database name?",
|
|
107
|
+
when: function (answer) {
|
|
108
|
+
var projectChoice = answer["template"];
|
|
109
|
+
return projectChoice == "db-schema";
|
|
110
|
+
}
|
|
87
111
|
},
|
|
88
112
|
];
|
|
89
113
|
console.log("Welcome to ".concat(name, " version ").concat(version));
|
|
@@ -97,10 +121,14 @@ function generateTemplate(templateDir, targetDirectory) {
|
|
|
97
121
|
// @ts-ignore
|
|
98
122
|
var author = answers['author'];
|
|
99
123
|
// @ts-ignore
|
|
100
|
-
var runInstall = answers['run_install'];
|
|
124
|
+
var runInstall = answers['run_install'] || false;
|
|
125
|
+
var masterDbName = answers['db_master'] || "master";
|
|
101
126
|
var templatePath = path.join(templateDir, projectChoice);
|
|
102
127
|
var targetPath = path.join(targetDirectory, projectName);
|
|
103
128
|
var templateConfig = getTemplateConfig(templatePath);
|
|
129
|
+
var params = {
|
|
130
|
+
masterDbName: masterDbName,
|
|
131
|
+
};
|
|
104
132
|
var options = {
|
|
105
133
|
projectName: projectName,
|
|
106
134
|
templateName: projectChoice,
|
|
@@ -111,7 +139,7 @@ function generateTemplate(templateDir, targetDirectory) {
|
|
|
111
139
|
if (!createProject(targetPath)) {
|
|
112
140
|
return;
|
|
113
141
|
}
|
|
114
|
-
createDirectoryContents(targetDirectory, templatePath, projectName, templateConfig, author);
|
|
142
|
+
createDirectoryContents(targetDirectory, templatePath, projectName, templateConfig, author, params);
|
|
115
143
|
if (runInstall && !postProcess(options)) {
|
|
116
144
|
return;
|
|
117
145
|
}
|
|
@@ -182,7 +210,7 @@ function postProcessNode(options) {
|
|
|
182
210
|
return true;
|
|
183
211
|
}
|
|
184
212
|
var SKIP_FILES = ['node_modules', '.template.json'];
|
|
185
|
-
function createDirectoryContents(targetDirectory, projectTemplatePath, projectName, config, author) {
|
|
213
|
+
function createDirectoryContents(targetDirectory, projectTemplatePath, projectName, config, author, params) {
|
|
186
214
|
var filesToCreate = fs.readdirSync(projectTemplatePath);
|
|
187
215
|
filesToCreate.forEach(function (file) {
|
|
188
216
|
var origFilePath = path.join(projectTemplatePath, file);
|
|
@@ -194,14 +222,14 @@ function createDirectoryContents(targetDirectory, projectTemplatePath, projectNa
|
|
|
194
222
|
var contents = fs.readFileSync(origFilePath, 'utf8');
|
|
195
223
|
if (file === '.npmignore-rename')
|
|
196
224
|
file = '.npmignore';
|
|
197
|
-
contents = render(contents, { projectName: projectName, author: author });
|
|
225
|
+
contents = render(contents, __assign(__assign({}, params), { projectName: projectName, author: author }));
|
|
198
226
|
var writePath = path.join(targetDirectory, projectName, file);
|
|
199
227
|
fs.writeFileSync(writePath, contents, 'utf8');
|
|
200
228
|
}
|
|
201
229
|
else if (stats.isDirectory()) {
|
|
202
230
|
fs.mkdirSync(path.join(targetDirectory, projectName, file));
|
|
203
231
|
// recursive call
|
|
204
|
-
createDirectoryContents(targetDirectory, path.join(projectTemplatePath, file), path.join(projectName, file), config, author);
|
|
232
|
+
createDirectoryContents(targetDirectory, path.join(projectTemplatePath, file), path.join(projectName, file), config, author, params);
|
|
205
233
|
}
|
|
206
234
|
});
|
|
207
235
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yBAA2B;AAC3B,uBAAyB;AACzB,mCAAqC;AACrC,+BAAiC;AACjC,+BAA0B;AAC1B,6BAA+B;AAC/B,2BAA6B;AAEvB,IAAA,KAAoB,OAAO,CAAC,oBAAoB,CAAC,EAA/C,IAAI,UAAA,EAAE,OAAO,aAAkC,CAAC;AAoBxD,SAAgB,MAAM,CAAC,OAAe,EAAE,IAAkB;IACtD,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAFD,wBAEC;AAED,SAAsB,gBAAgB,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AI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SACxI;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
package/src/utils/template.ts
CHANGED
|
@@ -62,7 +62,20 @@ export async function generateTemplate(templateDir: string, targetDirectory: str
|
|
|
62
62
|
name: "run_install",
|
|
63
63
|
type: "confirm",
|
|
64
64
|
message: "Do you want to run npm install after template created?",
|
|
65
|
+
when: (answer: any)=> {
|
|
66
|
+
const projectChoice = answer["template"]
|
|
67
|
+
return projectChoice !== "db-schema" || projectChoice !== "k8s-deployment"
|
|
68
|
+
}
|
|
65
69
|
},
|
|
70
|
+
{
|
|
71
|
+
name: "db_master",
|
|
72
|
+
type: "input",
|
|
73
|
+
message: "what is the master database name?",
|
|
74
|
+
when: (answer: any)=> {
|
|
75
|
+
const projectChoice = answer["template"]
|
|
76
|
+
return projectChoice == "db-schema"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
66
79
|
];
|
|
67
80
|
|
|
68
81
|
console.log(`Welcome to ${name} version ${version}`);
|
|
@@ -76,11 +89,16 @@ export async function generateTemplate(templateDir: string, targetDirectory: str
|
|
|
76
89
|
// @ts-ignore
|
|
77
90
|
const author = answers['author'];
|
|
78
91
|
// @ts-ignore
|
|
79
|
-
const runInstall = answers['run_install'];
|
|
92
|
+
const runInstall = answers['run_install'] || false;
|
|
93
|
+
const masterDbName = answers['db_master'] || "master";
|
|
80
94
|
const templatePath = path.join(templateDir, projectChoice);
|
|
81
95
|
const targetPath = path.join(targetDirectory, projectName);
|
|
82
96
|
const templateConfig = getTemplateConfig(templatePath);
|
|
83
97
|
|
|
98
|
+
const params = {
|
|
99
|
+
masterDbName,
|
|
100
|
+
}
|
|
101
|
+
|
|
84
102
|
const options: CliOptions = {
|
|
85
103
|
projectName,
|
|
86
104
|
templateName: projectChoice,
|
|
@@ -93,7 +111,7 @@ export async function generateTemplate(templateDir: string, targetDirectory: str
|
|
|
93
111
|
return;
|
|
94
112
|
}
|
|
95
113
|
|
|
96
|
-
createDirectoryContents(targetDirectory, templatePath, projectName, templateConfig, author);
|
|
114
|
+
createDirectoryContents(targetDirectory, templatePath, projectName, templateConfig, author, params);
|
|
97
115
|
|
|
98
116
|
if (runInstall && !postProcess(options)) {
|
|
99
117
|
return;
|
|
@@ -183,7 +201,7 @@ function postProcessNode(options: CliOptions) {
|
|
|
183
201
|
|
|
184
202
|
const SKIP_FILES = ['node_modules', '.template.json'];
|
|
185
203
|
|
|
186
|
-
function createDirectoryContents(targetDirectory: string, projectTemplatePath: string, projectName: string, config: TemplateConfig, author?: string) {
|
|
204
|
+
function createDirectoryContents(targetDirectory: string, projectTemplatePath: string, projectName: string, config: TemplateConfig, author?: string, params?: any) {
|
|
187
205
|
const filesToCreate = fs.readdirSync(projectTemplatePath);
|
|
188
206
|
|
|
189
207
|
filesToCreate.forEach(file => {
|
|
@@ -199,7 +217,7 @@ function createDirectoryContents(targetDirectory: string, projectTemplatePath: s
|
|
|
199
217
|
|
|
200
218
|
if (file === '.npmignore-rename') file = '.npmignore';
|
|
201
219
|
|
|
202
|
-
contents = render(contents, { projectName, author });
|
|
220
|
+
contents = render(contents, { ...params, projectName, author });
|
|
203
221
|
|
|
204
222
|
const writePath = path.join(targetDirectory, projectName, file);
|
|
205
223
|
fs.writeFileSync(writePath, contents, 'utf8');
|
|
@@ -207,7 +225,7 @@ function createDirectoryContents(targetDirectory: string, projectTemplatePath: s
|
|
|
207
225
|
fs.mkdirSync(path.join(targetDirectory, projectName, file));
|
|
208
226
|
|
|
209
227
|
// recursive call
|
|
210
|
-
createDirectoryContents(targetDirectory, path.join(projectTemplatePath, file), path.join(projectName, file), config, author);
|
|
228
|
+
createDirectoryContents(targetDirectory, path.join(projectTemplatePath, file), path.join(projectName, file), config, author, params);
|
|
211
229
|
}
|
|
212
230
|
});
|
|
213
231
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE DATABASE IF NOT EXISTS <%= masterDbName %> DEFAULT CHARACTER SET utf8;
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
DROP USER IF EXISTS 'app_service'@'%';
|
|
2
|
+
|
|
3
|
+
CREATE USER 'app_service'@'%' IDENTIFIED BY 'Password123';
|
|
4
|
+
|
|
5
|
+
-- Can grant table permission depend on usage
|
|
6
|
+
GRANT USAGE ON *.* TO 'app_service'@'%';
|
|
7
|
+
GRANT EXECUTE ON `sample_database`.* TO 'app_service'@'%';
|
|
8
|
+
GRANT SELECT, UPDATE ON `sample_database`.`table1` TO 'app_service'@'%';
|
|
9
|
+
GRANT SELECT, INSERT, UPDATE ON `sample_database`.`table2` TO 'app_service'@'%';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
DELIMITER $$
|
|
3
|
+
DROP PROCEDURE IF EXISTS `<%= masterDbName %>`.`sp_pipeline` $$
|
|
4
|
+
CREATE PROCEDURE `<%= masterDbName %>`.`sp_pipeline` () SQL SECURITY INVOKER
|
|
5
|
+
BEGIN
|
|
6
|
+
|
|
7
|
+
SELECT 'USE sample_database;';
|
|
8
|
+
|
|
9
|
+
SELECT '\nTRUNCATE TABLE sample_database.user;';
|
|
10
|
+
IF EXISTS (SELECT 1 FROM sample_database.user) THEN
|
|
11
|
+
SELECT 'INSERT INTO sample_database.user (id, name, cdate) VALUES';
|
|
12
|
+
SELECT CONCAT(''
|
|
13
|
+
, '(', CASE WHEN id IS NULL THEN 'NULL' ELSE id END
|
|
14
|
+
, ', ', CASE WHEN name IS NULL THEN 'NULL' ELSE CONCAT('''', name, '''') END
|
|
15
|
+
, ', UTC_TIMESTAMP'
|
|
16
|
+
, CASE WHEN (SELECT MAX(id) FROM sample_database.user) = id THEN ');' ELSE '),' END
|
|
17
|
+
)
|
|
18
|
+
FROM sample_database.user
|
|
19
|
+
ORDER BY id;
|
|
20
|
+
END IF;
|
|
21
|
+
|
|
22
|
+
END $$
|
|
23
|
+
|
|
24
|
+
CALL `<%= masterDbName %>`.`sp_pipeline`();
|
|
25
|
+
|
|
26
|
+
DROP PROCEDURE IF EXISTS `<%= masterDbName %>`.`sp_pipeline` $$
|
|
27
|
+
DELIMITER ;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
CREATE DATABASE IF NOT EXISTS `<%= masterDbName %>` DEFAULT CHARACTER SET utf8;
|
|
2
|
+
USE `<%= masterDbName %>`;
|
|
3
|
+
|
|
4
|
+
CREATE TABLE IF NOT EXISTS `release_version` (
|
|
5
|
+
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
|
6
|
+
`patch_id` varchar(30) NOT NULL COMMENT 'Tag ID in gitlab',
|
|
7
|
+
`release_desc` varchar(100) NOT NULL COMMENT 'release description',
|
|
8
|
+
`patch_start_date` datetime DEFAULT NULL,
|
|
9
|
+
`patch_end_date` datetime DEFAULT NULL,
|
|
10
|
+
`rollback_date` varchar(500) DEFAULT NULL COMMENT 'System Notes',
|
|
11
|
+
`rollback` tinyint(3) unsigned DEFAULT '0' COMMENT '0:No Rollback, 1:Rollback',
|
|
12
|
+
`status` tinyint(3) unsigned DEFAULT '0' COMMENT '0-Pending, 1-Successful, 4-Failed, 3-InProgress',
|
|
13
|
+
`cby` varchar(50) DEFAULT 'SYS',
|
|
14
|
+
`cdate` datetime NOT NULL,
|
|
15
|
+
`mby` varchar(50) DEFAULT NULL,
|
|
16
|
+
`mdate` datetime DEFAULT NULL,
|
|
17
|
+
`remarks` varchar(200) DEFAULT NULL COMMENT 'patching remarks',
|
|
18
|
+
PRIMARY KEY (`id`),
|
|
19
|
+
UNIQUE INDEX `patch_id_UNIQUE` (`patch_id` ASC)
|
|
20
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='For database object patching purposes';
|
|
21
|
+
|
|
22
|
+
DELIMITER $$
|
|
23
|
+
DROP PROCEDURE IF EXISTS `sp_get_version`$$
|
|
24
|
+
CREATE PROCEDURE `sp_get_version`(
|
|
25
|
+
IN p_target_version varchar(30)
|
|
26
|
+
)
|
|
27
|
+
SQL SECURITY INVOKER
|
|
28
|
+
BEGIN
|
|
29
|
+
DECLARE latest varchar(30);
|
|
30
|
+
|
|
31
|
+
SELECT patch_id INTO latest
|
|
32
|
+
FROM release_version
|
|
33
|
+
ORDER BY cdate DESC LIMIT 1;
|
|
34
|
+
|
|
35
|
+
IF latest IS NOT NULL THEN
|
|
36
|
+
IF latest != p_target_version THEN
|
|
37
|
+
IF EXISTS(SELECT 1 FROM release_version WHERE patch_id = p_target_version) THEN
|
|
38
|
+
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Duplicated target version';
|
|
39
|
+
END IF;
|
|
40
|
+
END IF;
|
|
41
|
+
END IF;
|
|
42
|
+
|
|
43
|
+
SELECT IFNULL(latest, '') AS `version`;
|
|
44
|
+
END$$
|
|
45
|
+
DELIMITER ;
|
|
46
|
+
|
|
47
|
+
CALL sp_get_version('{{VERSION}}');
|