1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-14 18:27:44 +02:00

Server: Fixed size of a database field

This commit is contained in:
Laurent Cozic 2021-07-03 20:37:27 +01:00
parent 082c8ffecb
commit 264f36f257
5 changed files with 26 additions and 1 deletions

Binary file not shown.

View File

@ -581,7 +581,7 @@ export const databaseSchema: DatabaseTables = {
can_share_folder: { type: 'number' },
can_share_note: { type: 'number' },
max_total_item_size: { type: 'string' },
total_item_size: { type: 'number' },
total_item_size: { type: 'string' },
},
};
// AUTO-GENERATED-TYPES

View File

@ -0,0 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', function(table: Knex.CreateTableBuilder) {
table.dropColumn('total_item_size');
});
}
export async function down(_db: DbConnection): Promise<any> {
}

View File

@ -0,0 +1,12 @@
import { Knex } from 'knex';
import { DbConnection } from '../db';
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('users', function(table: Knex.CreateTableBuilder) {
table.bigInteger('total_item_size').defaultTo(0).notNullable();
});
}
export async function down(_db: DbConnection): Promise<any> {
}

View File

@ -52,6 +52,7 @@ const propertyTypes: Record<string, string> = {
'users.can_share_note': 'number | null',
'users.max_total_item_size': 'number | null',
'users.max_item_size': 'number | null',
'users.total_item_size': 'number',
};
function insertContentIntoFile(filePath: string, markerOpen: string, markerClose: string, contentToInsert: string): void {