Browse Source

add migrate

animeic 2 years ago
parent
commit
d0e8250b47

+ 4 - 0
docker-compose.yaml

@@ -65,5 +65,9 @@ services:
       - oilseal-train-bus
     environment: 
       NATS: nats://oilseal-train-bus:4222
+      MONGO_MIGRATIONS: /data/migrations==mongodb://root:oilseal-train@oilseal-train-mongo:27017/oilseal-train?authSource=admin
+    
+    volumes:
+      - ./mongo-migrations:/data/migrations
 
   

+ 1 - 0
mongo-migrations/1672888071_users.down.json

@@ -0,0 +1 @@
+[]

+ 16 - 0
mongo-migrations/1672888071_users.up.json

@@ -0,0 +1,16 @@
+[
+    {
+        "insert": "users",
+        "documents": [{
+            "_id": {
+                "$oid": "6396e4e5c86efab805c47c78"
+            },
+            "loginName": "admin",
+            "password": "e10adc3949ba59abbe56e057f20f883e",
+            "name": "admin",
+            "role": "admin",
+            "state": 1
+        }]
+     }
+]
+

+ 1 - 0
mongo-migrations/1672888078_banks.down.json

@@ -0,0 +1 @@
+[]

+ 84 - 0
mongo-migrations/1672888078_banks.up.json

@@ -0,0 +1,84 @@
+[
+    {
+        "insert":"banks",
+        "documents":[
+            {
+                "_id":{
+                    "$oid":"6397f71e94ab390229bb866e"
+                },
+                "name":"燃调工作原理",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27c9843662056a4d76af8"
+                },
+                "name":"调节螺钉调整",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27cb843662056a4d76af9"
+                },
+                "name":"限流嘴放气嘴",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27cd343662056a4d76afa"
+                },
+                "name":"燃调拆装",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27ce743662056a4d76afb"
+                },
+                "name":"过滤嘴拆装清洗",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27cfe43662056a4d76afc"
+                },
+                "name":"感温矫正器",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27d0f43662056a4d76afd"
+                },
+                "name":"电子调节器",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63a27d2a43662056a4d76afe"
+                },
+                "name":"功率协调器",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63b3cc5ae372618160090354"
+                },
+                "name":"中心细滤",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63b3cc68e372618160090355"
+                },
+                "name":"进口油滤",
+                "state":1
+            },
+            {
+                "_id":{
+                    "$oid":"63b3cc84e372618160090356"
+                },
+                "name":"空气滤",
+                "state":1
+            }
+        ]
+    }
+]