Clang: Add file informations table

We could add this properties to the sources table but then we have to
handle null values which makes the SQL statements much more complicated
and most probably slower too.

Change-Id: Ie2a1e4862b0517825292213567725d6c18abfb30
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-01-29 15:15:44 +01:00
parent c0b771f99c
commit 8aef667ad7
2 changed files with 23 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ public:
createProjectPartsTable();
createProjectPartsSourcesTable();
createUsedMacrosTable();
createFileInformationsTable();
transaction.commit();
}
@@ -146,6 +147,18 @@ public:
table.initialize(database);
}
void createFileInformationsTable()
{
Sqlite::Table table;
table.setUseIfNotExists(true);
table.setName("fileInformations");
table.addColumn("sourceId", Sqlite::ColumnType::Integer, Sqlite::Contraint::PrimaryKey);
table.addColumn("size", Sqlite::ColumnType::Integer);
table.addColumn("lastModified", Sqlite::ColumnType::Integer);
table.initialize(database);
}
public:
DatabaseType &database;
};