Clang: Add source dependencies table

We want to track which source is dependent on which source.

Change-Id: I4b3c14be540974d69cc5026a5d081be1baceb133
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-01-30 14:34:06 +01:00
parent 5dd24110f5
commit c29ae225c5
2 changed files with 24 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ public:
createProjectPartsSourcesTable();
createUsedMacrosTable();
createFileInformationsTable();
createSourceDependenciesTable();
transaction.commit();
}
@@ -159,6 +160,17 @@ public:
table.initialize(database);
}
void createSourceDependenciesTable()
{
Sqlite::Table table;
table.setUseIfNotExists(true);
table.setName("sourceDependencies");
const Sqlite::Column &sourceIdColumn = table.addColumn("sourceId", Sqlite::ColumnType::Integer);
const Sqlite::Column &dependencySourceIdColumn = table.addColumn("dependencySourceId", Sqlite::ColumnType::Integer);
table.addIndex({sourceIdColumn, dependencySourceIdColumn});
table.initialize(database);
}
public:
DatabaseType &database;
};