mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
migration now works also in electron
This commit is contained in:
parent
719f553054
commit
7bdf269095
1
migrations/0047__test.sql
Normal file
1
migrations/0047__test.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
SELECT 1;
|
@ -106,10 +106,6 @@ $(document).tooltip({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function isElectron() {
|
|
||||||
return window && window.process && window.process.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
let appShown = false;
|
let appShown = false;
|
||||||
|
|
||||||
function showAppIfHidden() {
|
function showAppIfHidden() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
$.get(baseApiUrl + 'migration').then(result => {
|
server.get('migration').then(result => {
|
||||||
const appDbVersion = result.app_db_version;
|
const appDbVersion = result.app_db_version;
|
||||||
const dbVersion = result.db_version;
|
const dbVersion = result.db_version;
|
||||||
|
|
||||||
@ -22,11 +22,7 @@ $("#run-migration").click(async () => {
|
|||||||
|
|
||||||
$("#migration-result").show();
|
$("#migration-result").show();
|
||||||
|
|
||||||
const result = await $.ajax({
|
const result = await server.post('migration');
|
||||||
url: baseApiUrl + 'migration',
|
|
||||||
type: 'POST',
|
|
||||||
error: () => showError("Migration failed with unknown error")
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const migration of result.migrations) {
|
for (const migration of result.migrations) {
|
||||||
const row = $('<tr>')
|
const row = $('<tr>')
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
const server = (function() {
|
const server = (function() {
|
||||||
function getHeaders() {
|
function getHeaders() {
|
||||||
|
let protectedSessionId = null;
|
||||||
|
|
||||||
|
try { // this is because protected session might not be declared in some cases - like when it's included in migration page
|
||||||
|
protectedSessionId = protected_session.getProtectedSessionId();
|
||||||
|
}
|
||||||
|
catch(e) {}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'x-protected-session-id': protected_session.getProtectedSessionId()
|
'x-protected-session-id': protectedSessionId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,4 +46,8 @@ function formatDate(date) {
|
|||||||
|
|
||||||
function formatDateTime(date) {
|
function formatDateTime(date) {
|
||||||
return formatDate(date) + " " + formatTime(date);
|
return formatDate(date) + " " + formatTime(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isElectron() {
|
||||||
|
return window && window.process && window.process.type;
|
||||||
}
|
}
|
@ -1 +1 @@
|
|||||||
module.exports = { build_date:"2017-11-28T22:01:30-05:00", build_revision: "14001f67d87a7c7d900088807337fcda0d2fb9a0" };
|
module.exports = { build_date:"2017-11-30T00:11:04-05:00", build_revision: "719f5530544efa1d7aae16afd8a9e64db04ff206" };
|
||||||
|
@ -4,7 +4,7 @@ const options = require('./options');
|
|||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const log = require('./log');
|
const log = require('./log');
|
||||||
|
|
||||||
const APP_DB_VERSION = 46;
|
const APP_DB_VERSION = 47;
|
||||||
const MIGRATIONS_DIR = "migrations";
|
const MIGRATIONS_DIR = "migrations";
|
||||||
|
|
||||||
async function migrate() {
|
async function migrate() {
|
||||||
|
@ -301,6 +301,7 @@
|
|||||||
|
|
||||||
<link href="stylesheets/style.css" rel="stylesheet">
|
<link href="stylesheets/style.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<script src="javascripts/utils.js"></script>
|
||||||
<script src="javascripts/init.js"></script>
|
<script src="javascripts/init.js"></script>
|
||||||
<script src="javascripts/server.js"></script>
|
<script src="javascripts/server.js"></script>
|
||||||
|
|
||||||
@ -329,6 +330,5 @@
|
|||||||
<script src="javascripts/link.js"></script>
|
<script src="javascripts/link.js"></script>
|
||||||
<script src="javascripts/sync.js"></script>
|
<script src="javascripts/sync.js"></script>
|
||||||
<script src="javascripts/messaging.js"></script>
|
<script src="javascripts/messaging.js"></script>
|
||||||
<script src="javascripts/utils.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -60,5 +60,7 @@
|
|||||||
<script src="libraries/bootstrap/js/bootstrap.js"></script>
|
<script src="libraries/bootstrap/js/bootstrap.js"></script>
|
||||||
|
|
||||||
<script src="javascripts/migration.js"></script>
|
<script src="javascripts/migration.js"></script>
|
||||||
|
<script src="javascripts/utils.js"></script>
|
||||||
|
<script src="javascripts/server.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user