2019-01-23 17:01:48 +01:00
|
|
|
/*
|
|
|
|
* This file is part of Player Analytics (Plan).
|
|
|
|
*
|
|
|
|
* Plan is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License v3 as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Plan is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-08-30 22:14:54 +02:00
|
|
|
package com.djrapitops.plan.storage.database.transactions.init;
|
2019-01-23 17:01:48 +01:00
|
|
|
|
2019-08-30 22:14:54 +02:00
|
|
|
import com.djrapitops.plan.storage.database.sql.tables.*;
|
2022-05-20 18:31:46 +02:00
|
|
|
import com.djrapitops.plan.storage.database.transactions.events.StoreJoinAddressTransaction;
|
2019-01-23 17:01:48 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Transaction that creates the table schema of Plan database.
|
|
|
|
*
|
2021-02-13 14:16:03 +01:00
|
|
|
* @author AuroraLS3
|
2019-01-23 17:01:48 +01:00
|
|
|
*/
|
|
|
|
public class CreateTablesTransaction extends OperationCriticalTransaction {
|
|
|
|
|
|
|
|
@Override
|
2019-01-24 18:10:40 +01:00
|
|
|
protected void performOperations() {
|
2019-12-05 19:22:33 +01:00
|
|
|
// DBType is required for SQL creation, as MySQL and SQLite primary key format differs.
|
2019-01-23 17:01:48 +01:00
|
|
|
|
|
|
|
// Create statements are run in a specific order as some tables have foreign keys,
|
|
|
|
// or had at some point in the past.
|
|
|
|
execute(ServerTable.createTableSQL(dbType));
|
|
|
|
execute(UsersTable.createTableSQL(dbType));
|
|
|
|
execute(UserInfoTable.createTableSQL(dbType));
|
|
|
|
execute(GeoInfoTable.createTableSQL(dbType));
|
|
|
|
execute(NicknamesTable.createTableSQL(dbType));
|
2022-05-20 18:31:46 +02:00
|
|
|
execute(JoinAddressTable.createTableSQL(dbType));
|
|
|
|
executeOther(new StoreJoinAddressTransaction(JoinAddressTable.DEFAULT_VALUE_FOR_LOOKUP));
|
2019-01-23 17:01:48 +01:00
|
|
|
execute(SessionsTable.createTableSQL(dbType));
|
|
|
|
execute(KillsTable.createTableSQL(dbType));
|
|
|
|
execute(PingTable.createTableSQL(dbType));
|
|
|
|
execute(TPSTable.createTableSQL(dbType));
|
|
|
|
execute(WorldTable.createTableSQL(dbType));
|
|
|
|
execute(WorldTimesTable.createTableSQL(dbType));
|
|
|
|
execute(SettingsTable.createTableSQL(dbType));
|
2021-03-20 11:02:02 +01:00
|
|
|
execute(CookieTable.createTableSQL(dbType));
|
2022-06-24 10:09:14 +02:00
|
|
|
execute(AccessLogTable.createTableSql(dbType));
|
2023-08-20 10:56:13 +02:00
|
|
|
execute(WebGroupTable.createTableSQL(dbType));
|
|
|
|
execute(WebPermissionTable.createTableSQL(dbType));
|
|
|
|
execute(WebGroupToPermissionTable.createTableSQL(dbType));
|
|
|
|
execute(SecurityTable.createTableSQL(dbType));
|
2019-03-18 18:56:16 +01:00
|
|
|
|
|
|
|
// DataExtension tables
|
|
|
|
execute(ExtensionIconTable.createTableSQL(dbType));
|
|
|
|
execute(ExtensionPluginTable.createTableSQL(dbType));
|
|
|
|
execute(ExtensionTabTable.createTableSQL(dbType));
|
|
|
|
execute(ExtensionProviderTable.createTableSQL(dbType));
|
|
|
|
execute(ExtensionPlayerValueTable.createTableSQL(dbType));
|
2019-03-29 10:32:32 +01:00
|
|
|
execute(ExtensionServerValueTable.createTableSQL(dbType));
|
2019-04-14 09:31:30 +02:00
|
|
|
execute(ExtensionTableProviderTable.createTableSQL(dbType));
|
|
|
|
execute(ExtensionPlayerTableValueTable.createTableSQL(dbType));
|
|
|
|
execute(ExtensionServerTableValueTable.createTableSQL(dbType));
|
2019-08-26 14:51:02 +02:00
|
|
|
execute(ExtensionGroupsTable.createTableSQL(dbType));
|
2019-01-23 17:01:48 +01:00
|
|
|
}
|
|
|
|
}
|