Automatically run migration script when loading the registration page.

This commit is contained in:
Miguel Ribeiro 2024-02-14 16:54:16 +01:00
parent 3237d1f22f
commit 323679e771
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
!/images/uploads/logos/wallos.png
.DS_Store
.idea/
.vscode/

View File

@ -52,7 +52,18 @@ function changeLanguage(selectedLanguage) {
location.reload();
}
function runDatabaseMigration() {
let url = "endpoints/db/migrate.php";
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error(translate('network_response_error'));
}
});
}
window.onload = function () {
restoreFormFields();
removeFromStorage();
runDatabaseMigration();
};