mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-28 21:24:28 +00:00
feat: rename san
to subjectAltNames
, workflow
to workflowId
, nodeId
to workflowNodeId
, output
to workflowOutputId
, log
to logs
, succeed
to succeeded
This commit is contained in:
144
migrations/1735977005_updated_workflow_output.go
Normal file
144
migrations/1735977005_updated_workflow_output.go
Normal file
@@ -0,0 +1,144 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("bqnxb95f2cooowp")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_workflowId := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "jka88auc",
|
||||
"name": "workflowId",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "tovyif5ax6j62ur",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": null
|
||||
}
|
||||
}`), edit_workflowId); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_workflowId)
|
||||
|
||||
// update
|
||||
edit_outputs := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "he4cceqb",
|
||||
"name": "outputs",
|
||||
"type": "json",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSize": 2000000
|
||||
}
|
||||
}`), edit_outputs); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_outputs)
|
||||
|
||||
// update
|
||||
edit_succeeded := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "2yfxbxuf",
|
||||
"name": "succeeded",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), edit_succeeded); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_succeeded)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("bqnxb95f2cooowp")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_workflowId := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "jka88auc",
|
||||
"name": "workflow",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "tovyif5ax6j62ur",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": null
|
||||
}
|
||||
}`), edit_workflowId); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_workflowId)
|
||||
|
||||
// update
|
||||
edit_outputs := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "he4cceqb",
|
||||
"name": "output",
|
||||
"type": "json",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSize": 2000000
|
||||
}
|
||||
}`), edit_outputs); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_outputs)
|
||||
|
||||
// update
|
||||
edit_succeeded := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "2yfxbxuf",
|
||||
"name": "succeed",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), edit_succeeded); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_succeeded)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user