add another db table (sql dbs)

This commit is contained in:
2023-07-26 08:18:20 +02:00
parent 782a245c17
commit d0b215f022
3 changed files with 10 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ if ( settings.init ) {
} }
console.log( '[ Server ] loading plugins' ); console.log( '[ Server ] loading plugins' );
pluginManager.load( app, settings ); // pluginManager.load( app, settings );
app.use( ( request, response ) => { app.use( ( request, response ) => {
response.sendFile( file ); response.sendFile( file );

View File

@@ -41,7 +41,10 @@ class SQLDB {
if ( error ) if ( error.code !== 'ER_BAD_TABLE_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_BAD_TABLE_ERROR' ) throw error;
this.sqlConnection.query( 'DROP TABLE libreevent_admin;', ( error ) => { this.sqlConnection.query( 'DROP TABLE libreevent_admin;', ( error ) => {
if ( error ) if ( error.code !== 'ER_BAD_TABLE_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_BAD_TABLE_ERROR' ) throw error;
return 'done'; this.sqlConnection.query( 'DROP TABLE libreevent_temp;', ( error ) => {
if ( error ) if ( error.code !== 'ER_BAD_TABLE_ERROR' ) throw error;
return 'done';
} );
} ); } );
} ); } );
} ); } );
@@ -54,10 +57,13 @@ class SQLDB {
} ); } );
this.sqlConnection.query( 'CREATE TABLE libreevent_users ( account_id INT ( 10 ) NOT NULL AUTO_INCREMENT, email TINYTEXT NOT NULL, pass TEXT, street TEXT, house_number TINYTEXT, country TEXT, phone TEXT, name TEXT, first_name TEXT, data VARCHAR( 10000 ), PRIMARY KEY ( account_id ) ) ENGINE=INNODB;', ( error ) => { this.sqlConnection.query( 'CREATE TABLE libreevent_users ( account_id INT ( 10 ) NOT NULL AUTO_INCREMENT, email TINYTEXT NOT NULL, pass TEXT, street TEXT, house_number TINYTEXT, country TEXT, phone TEXT, name TEXT, first_name TEXT, data VARCHAR( 10000 ), PRIMARY KEY ( account_id ) ) ENGINE=INNODB;', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;
this.sqlConnection.query( 'CREATE TABLE libreevent_orders ( order_id INT ( 10 ) NOT NULL AUTO_INCREMENT, account_id INT ( 10 ) NOT NULL, seats VARCHAR( 30000 ), PRIMARY KEY ( order_id ), FOREIGN KEY ( account_id ) REFERENCES libreevent_users( account_id ) ) ENGINE=INNODB;', ( error ) => { this.sqlConnection.query( 'CREATE TABLE libreevent_orders ( order_id INT ( 10 ) NOT NULL AUTO_INCREMENT, account_id INT ( 10 ) NOT NULL, seats VARCHAR( 60000 ), PRIMARY KEY ( order_id ), FOREIGN KEY ( account_id ) REFERENCES libreevent_users( account_id ) ) ENGINE=INNODB;', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;
this.sqlConnection.query( 'CREATE TABLE libreevent_admin ( account_id INT NOT NULL AUTO_INCREMENT, email TINYTEXT, pass TEXT, permissions VARCHAR( 1000 ), PRIMARY KEY ( account_id ) );', ( error ) => { this.sqlConnection.query( 'CREATE TABLE libreevent_admin ( account_id INT NOT NULL AUTO_INCREMENT, email TINYTEXT, pass TEXT, permissions VARCHAR( 1000 ), PRIMARY KEY ( account_id ) );', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error; if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;
this.sqlConnection.query( 'CREATE TABLE libreevent_temp ( entry_id INT NOT NULL AUTO_INCREMENT, user_id TINYTEXT, pass TEXT, data VARCHAR( 60000 ), PRIMARY KEY ( entry_id ) );', ( error ) => {
if ( error ) if ( error.code !== 'ER_TABLE_EXISTS_ERROR' ) throw error;
} );
} ); } );
} ); } );
} ); } );

View File

@@ -255,6 +255,7 @@ export default {
user a link to download the ticket. A mail has been sent to user automatically. user a link to download the ticket. A mail has been sent to user automatically.
*/ */
let prep = this.$refs.notification.createNotification( 'Preparing payment...', 20, 'progress', 'high' ); let prep = this.$refs.notification.createNotification( 'Preparing payment...', 20, 'progress', 'high' );
setTimeout( () => { setTimeout( () => {
this.$refs.notification.cancelNotification( prep ); this.$refs.notification.cancelNotification( prep );
this.$refs.notification.createNotification( 'Payment prepared, redirecting...', 5, 'progress', 'high' ); this.$refs.notification.createNotification( 'Payment prepared, redirecting...', 5, 'progress', 'high' );