snapshot of https://github.com/golang-migrate/migrate.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
[
|
||||
{
|
||||
"dropUser": "deminem"
|
||||
}
|
||||
]
|
||||
12
database/mongodb/examples/migrations/001_create_user.up.json
Normal file
12
database/mongodb/examples/migrations/001_create_user.up.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"createUser": "deminem",
|
||||
"pwd": "gogo",
|
||||
"roles": [
|
||||
{
|
||||
"role": "readWrite",
|
||||
"db": "testMigration"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"dropIndexes": "mycollection",
|
||||
"index": "username_sort_by_asc_created"
|
||||
},
|
||||
{
|
||||
"dropIndexes": "mycollection",
|
||||
"index": "unique_email"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
[{
|
||||
"createIndexes": "mycollection",
|
||||
"indexes": [
|
||||
{
|
||||
"key": {
|
||||
"username": 1,
|
||||
"created": -1
|
||||
},
|
||||
"name": "username_sort_by_asc_created",
|
||||
"background": true
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"email": 1
|
||||
},
|
||||
"name": "unique_email",
|
||||
"unique": true,
|
||||
"background": true
|
||||
}
|
||||
]
|
||||
}]
|
||||
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"update": "users",
|
||||
"updates": [
|
||||
{
|
||||
"q": {},
|
||||
"u": {
|
||||
"$unset": {
|
||||
"status": ""
|
||||
}
|
||||
},
|
||||
"multi": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"update": "users",
|
||||
"updates": [
|
||||
{
|
||||
"q": {},
|
||||
"u": {
|
||||
"$set": {
|
||||
"status": "active"
|
||||
}
|
||||
},
|
||||
"multi": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"update": "users",
|
||||
"updates": [
|
||||
{
|
||||
"q": {},
|
||||
"u": {
|
||||
"fullname": ""
|
||||
},
|
||||
"multi": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"aggregate": "users",
|
||||
"pipeline": [
|
||||
{
|
||||
"$project": {
|
||||
"_id": 1,
|
||||
"firstname": 1,
|
||||
"lastname": 1,
|
||||
"username": 1,
|
||||
"password": 1,
|
||||
"email": 1,
|
||||
"active": 1,
|
||||
"fullname": { "$concat": ["$firstname", " ", "$lastname"] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"$out": "users"
|
||||
}
|
||||
],
|
||||
"cursor": {}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user