Skip to content

Commit

Permalink
Automatically run migration script when loading the registration page.
Browse files Browse the repository at this point in the history
  • Loading branch information
ellite committed Feb 14, 2024
1 parent 3237d1f commit 323679e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
!/images/uploads/logos/wallos.png
.DS_Store
.idea/
.vscode/
11 changes: 11 additions & 0 deletions scripts/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

0 comments on commit 323679e

Please sign in to comment.