Remove unused table and fix update DB lock, which fucked with update schema process.
This commit is contained in:
		
							parent
							
								
									693d098e90
								
							
						
					
					
						commit
						8a21914e4f
					
				
					 5 changed files with 6 additions and 25 deletions
				
			
		| 
						 | 
				
			
			@ -46,17 +46,6 @@ CREATE TABLE IF NOT EXISTS Feeds (
 | 
			
		|||
  type            INTEGER       NOT NULL CHECK (type >= 0)
 | 
			
		||||
);
 | 
			
		||||
-- !
 | 
			
		||||
DROP TABLE IF EXISTS FeedsData;
 | 
			
		||||
-- !
 | 
			
		||||
CREATE TABLE IF NOT EXISTS FeedsData (
 | 
			
		||||
  feed_id         INTEGER       NOT NULL,
 | 
			
		||||
  feed_key        VARCHAR(100)  NOT NULL,
 | 
			
		||||
  feed_value      TEXT,
 | 
			
		||||
  
 | 
			
		||||
  PRIMARY KEY (feed_id, feed_key),
 | 
			
		||||
  FOREIGN KEY (feed_id) REFERENCES Feeds (id)
 | 
			
		||||
);
 | 
			
		||||
-- !
 | 
			
		||||
DROP TABLE IF EXISTS Messages;
 | 
			
		||||
-- !
 | 
			
		||||
CREATE TABLE IF NOT EXISTS Messages (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,17 +40,6 @@ CREATE TABLE IF NOT EXISTS Feeds (
 | 
			
		|||
  type            INTEGER     NOT NULL CHECK (type >= 0)
 | 
			
		||||
);
 | 
			
		||||
-- !
 | 
			
		||||
DROP TABLE IF EXISTS FeedsData;
 | 
			
		||||
-- !
 | 
			
		||||
CREATE TABLE IF NOT EXISTS FeedsData (
 | 
			
		||||
  feed_id         INTEGER     NOT NULL,
 | 
			
		||||
  feed_key        TEXT        NOT NULL,
 | 
			
		||||
  feed_value      TEXT,
 | 
			
		||||
  
 | 
			
		||||
  PRIMARY KEY (feed_id, feed_key),
 | 
			
		||||
  FOREIGN KEY (feed_id) REFERENCES Feeds (id)
 | 
			
		||||
);
 | 
			
		||||
-- !
 | 
			
		||||
DROP TABLE IF EXISTS Messages;
 | 
			
		||||
-- !
 | 
			
		||||
CREATE TABLE IF NOT EXISTS Messages (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
INSERT INTO Information (inf_key, inf_value) VALUES ('standard_account_enabled', 1);
 | 
			
		||||
-- !
 | 
			
		||||
DROP TABLE IF EXISTS FeedsData;
 | 
			
		||||
-- !
 | 
			
		||||
UPDATE Information SET inf_value = '4' WHERE inf_key = 'schema_version';
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
INSERT INTO Information (inf_key, inf_value) VALUES ('standard_account_enabled', 1);
 | 
			
		||||
-- !
 | 
			
		||||
DROP TABLE IF EXISTS FeedsData;
 | 
			
		||||
-- !
 | 
			
		||||
UPDATE Information SET inf_value = '4' WHERE inf_key = 'schema_version';
 | 
			
		||||
| 
						 | 
				
			
			@ -290,12 +290,13 @@ QSqlDatabase DatabaseFactory::sqliteInitializeFileBasedDatabase(const QString &c
 | 
			
		|||
      }
 | 
			
		||||
 | 
			
		||||
      database.commit();
 | 
			
		||||
      query_db.finish();
 | 
			
		||||
      qDebug("File-based SQLite database backend should be ready now.");
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      query_db.next();
 | 
			
		||||
 | 
			
		||||
      QString installed_db_schema = query_db.value(0).toString();
 | 
			
		||||
      query_db.finish();
 | 
			
		||||
 | 
			
		||||
      if (!updateDatabaseSchema(database, installed_db_schema)) {
 | 
			
		||||
        qFatal("Database schema was not updated from '%s' to '%s' successully.",
 | 
			
		||||
| 
						 | 
				
			
			@ -313,8 +314,6 @@ QSqlDatabase DatabaseFactory::sqliteInitializeFileBasedDatabase(const QString &c
 | 
			
		|||
             qPrintable(QDir::toNativeSeparators(database.databaseName())));
 | 
			
		||||
      qDebug("File-based SQLite database has version '%s'.", qPrintable(installed_db_schema));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    query_db.finish();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Everything is initialized now.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue