package migrations import ( "github.com/pocketbase/pocketbase/core" m "github.com/pocketbase/pocketbase/migrations" ) func init() { m.Register(func(app core.App) error { jsonData := `[ { "createRule": null, "deleteRule": null, "fields": [ { "autogeneratePattern": "[a-z0-9]{15}", "hidden": false, "id": "text3208210256", "max": 15, "min": 15, "name": "id", "pattern": "^[a-z0-9]+$", "presentable": false, "primaryKey": true, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text455797646", "max": 0, "min": 0, "name": "collectionRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text127846527", "max": 0, "min": 0, "name": "recordRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text1582905952", "max": 0, "min": 0, "name": "method", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "hidden": false, "id": "autodate2990389176", "name": "created", "onCreate": true, "onUpdate": false, "presentable": false, "system": true, "type": "autodate" }, { "hidden": false, "id": "autodate3332085495", "name": "updated", "onCreate": true, "onUpdate": true, "presentable": false, "system": true, "type": "autodate" } ], "id": "pbc_2279338944", "indexes": [ "CREATE INDEX ` + "`" + `idx_mfas_collectionRef_recordRef` + "`" + ` ON ` + "`" + `_mfas` + "`" + ` (collectionRef,recordRef)" ], "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", "name": "_mfas", "system": true, "type": "base", "updateRule": null, "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" }, { "createRule": null, "deleteRule": null, "fields": [ { "autogeneratePattern": "[a-z0-9]{15}", "hidden": false, "id": "text3208210256", "max": 15, "min": 15, "name": "id", "pattern": "^[a-z0-9]+$", "presentable": false, "primaryKey": true, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text455797646", "max": 0, "min": 0, "name": "collectionRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text127846527", "max": 0, "min": 0, "name": "recordRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "cost": 8, "hidden": true, "id": "password901924565", "max": 0, "min": 0, "name": "password", "pattern": "", "presentable": false, "required": true, "system": true, "type": "password" }, { "autogeneratePattern": "", "hidden": true, "id": "text3866985172", "max": 0, "min": 0, "name": "sentTo", "pattern": "", "presentable": false, "primaryKey": false, "required": false, "system": true, "type": "text" }, { "hidden": false, "id": "autodate2990389176", "name": "created", "onCreate": true, "onUpdate": false, "presentable": false, "system": true, "type": "autodate" }, { "hidden": false, "id": "autodate3332085495", "name": "updated", "onCreate": true, "onUpdate": true, "presentable": false, "system": true, "type": "autodate" } ], "id": "pbc_1638494021", "indexes": [ "CREATE INDEX ` + "`" + `idx_otps_collectionRef_recordRef` + "`" + ` ON ` + "`" + `_otps` + "`" + ` (collectionRef, recordRef)" ], "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", "name": "_otps", "system": true, "type": "base", "updateRule": null, "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" }, { "createRule": null, "deleteRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", "fields": [ { "autogeneratePattern": "[a-z0-9]{15}", "hidden": false, "id": "text3208210256", "max": 15, "min": 15, "name": "id", "pattern": "^[a-z0-9]+$", "presentable": false, "primaryKey": true, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text455797646", "max": 0, "min": 0, "name": "collectionRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text127846527", "max": 0, "min": 0, "name": "recordRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text2462348188", "max": 0, "min": 0, "name": "provider", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text1044722854", "max": 0, "min": 0, "name": "providerId", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "hidden": false, "id": "autodate2990389176", "name": "created", "onCreate": true, "onUpdate": false, "presentable": false, "system": true, "type": "autodate" }, { "hidden": false, "id": "autodate3332085495", "name": "updated", "onCreate": true, "onUpdate": true, "presentable": false, "system": true, "type": "autodate" } ], "id": "pbc_2281828961", "indexes": [ "CREATE UNIQUE INDEX ` + "`" + `idx_externalAuths_record_provider` + "`" + ` ON ` + "`" + `_externalAuths` + "`" + ` (collectionRef, recordRef, provider)", "CREATE UNIQUE INDEX ` + "`" + `idx_externalAuths_collection_provider` + "`" + ` ON ` + "`" + `_externalAuths` + "`" + ` (collectionRef, provider, providerId)" ], "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", "name": "_externalAuths", "system": true, "type": "base", "updateRule": null, "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" }, { "createRule": null, "deleteRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", "fields": [ { "autogeneratePattern": "[a-z0-9]{15}", "hidden": false, "id": "text3208210256", "max": 15, "min": 15, "name": "id", "pattern": "^[a-z0-9]+$", "presentable": false, "primaryKey": true, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text455797646", "max": 0, "min": 0, "name": "collectionRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text127846527", "max": 0, "min": 0, "name": "recordRef", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "autogeneratePattern": "", "hidden": false, "id": "text4228609354", "max": 0, "min": 0, "name": "fingerprint", "pattern": "", "presentable": false, "primaryKey": false, "required": true, "system": true, "type": "text" }, { "hidden": false, "id": "autodate2990389176", "name": "created", "onCreate": true, "onUpdate": false, "presentable": false, "system": true, "type": "autodate" }, { "hidden": false, "id": "autodate3332085495", "name": "updated", "onCreate": true, "onUpdate": true, "presentable": false, "system": true, "type": "autodate" } ], "id": "pbc_4275539003", "indexes": [ "CREATE UNIQUE INDEX ` + "`" + `idx_authOrigins_unique_pairs` + "`" + ` ON ` + "`" + `_authOrigins` + "`" + ` (collectionRef, recordRef, fingerprint)" ], "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", "name": "_authOrigins", "system": true, "type": "base", "updateRule": null, "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" }, { "authAlert": { "emailTemplate": { "body": "
Hello,
\nWe noticed a login to your {APP_NAME} account from a new location:
\n{ALERT_INFO}
\nIf this wasn't you, you should immediately change your {APP_NAME} account password to revoke access from all other locations.
\nIf this was you, you may disregard this email.
\n\n Thanks,
\n {APP_NAME} team\n
Hello,
\nClick on the button below to confirm your new email address.
\n\n Confirm new email\n
\nIf you didn't ask to change your email address, you can ignore this email.
\n\n Thanks,
\n {APP_NAME} team\n
Hello,
\nYour one-time password is: {OTP}
\nIf you didn't ask for the one-time password, you can ignore this email.
\n\n Thanks,
\n {APP_NAME} team\n
Hello,
\nClick on the button below to reset your password.
\n\n Reset password\n
\nIf you didn't ask to reset your password, you can ignore this email.
\n\n Thanks,
\n {APP_NAME} team\n
Hello,
\nThank you for joining us at {APP_NAME}.
\nClick on the button below to verify your email address.
\n\n Verify\n
\n\n Thanks,
\n {APP_NAME} team\n