src/main/java/me/firewolf8385/flameperms/MySQL.java
/**
     * Create the tables used by the plugin.
     */
Create the tables used by the plugin.
Create the tables used by the plugin .
public static void createTables()
    {
        if(!tableExists("fp_groups"))
        {
            try
            {
                PreparedStatement statement = MySQL.getConnection().prepareStatement("CREATE TABLE `" + database + "`.`fp_groups` (`name` VARCHAR(45) NULL,`family` VARCHAR(45) NULL DEFAULT 'none',`orderNum` INT NULL DEFAULT 1);");
                statement.executeUpdate();
            }
            catch(SQLException e)
            {
                e.printStackTrace();
            }
        }
        if(!tableExists("fp_group_permissions"))
        {
            try
            {
                PreparedStatement statement = MySQL.getConnection().prepareStatement("CREATE TABLE `" + database + "`.`fp_group_permissions` (`name` VARCHAR(45) NULL,`permission` VARCHAR(45) NULL);");
                statement.executeUpdate();
            }
            catch(SQLException e)
            {
                e.printStackTrace();
            }
        }
        if(!tableExists("fb_users"))
        {
            try
            {
                PreparedStatement statement = MySQL.getConnection().prepareStatement("CREATE TABLE `" + database + "`.`fp_users` (`uuid` VARCHAR(36) NULL, `groupName` VARCHAR(45) NULL DEFAULT 'default');");
                statement.executeUpdate();
            }
            catch(SQLException e)
            {
                e.printStackTrace();
            }
            try
            {
                PreparedStatement statement = MySQL.getConnection().prepareStatement("INSERT INTO `fp_users` (name) VALUES 'default'");
                statement.executeUpdate();
            }
            catch(SQLException e)
            {
                e.printStackTrace();
            }
        }
    }
public static void createTables ( ) { if ( ! tableExists ( "fp_groups" ) ) { try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "CREATE TABLE `" + database + "`.`fp_groups` (`name` VARCHAR(45) NULL,`family` VARCHAR(45) NULL DEFAULT 'none',`orderNum` INT NULL DEFAULT 1);" ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } if ( ! tableExists ( "fp_group_permissions" ) ) { try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "CREATE TABLE `" + database + "`.`fp_group_permissions` (`name` VARCHAR(45) NULL,`permission` VARCHAR(45) NULL);" ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } if ( ! tableExists ( "fb_users" ) ) { try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "CREATE TABLE `" + database + "`.`fp_users` (`uuid` VARCHAR(36) NULL, `groupName` VARCHAR(45) NULL DEFAULT 'default');" ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "INSERT INTO `fp_users` (name) VALUES 'default'" ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } }
Create the tables used by the plugin.
Create the tables used by the plugin .
// "sp_groups" // "sp_group_permissions" // "sp_users"