25 lines
844 B
C#
25 lines
844 B
C#
|
using Npgsql;
|
|||
|
|
|||
|
namespace DeukBot4.Database
|
|||
|
{
|
|||
|
public static class DatabaseInitializer
|
|||
|
{
|
|||
|
public static void Initialize()
|
|||
|
{
|
|||
|
using (var conn = new DatabaseConnection())
|
|||
|
{
|
|||
|
using (var cmd = new NpgsqlCommand())
|
|||
|
{
|
|||
|
cmd.Connection = conn;
|
|||
|
cmd.CommandText = "CREATE TABLE IF NOT EXISTS permission_roles (" +
|
|||
|
"server_id bigint NOT NULL," +
|
|||
|
"role_id bigint NOT NULL," +
|
|||
|
"permission_level smallint NOT NULL," +
|
|||
|
"PRIMARY KEY(server_id, role_id)" +
|
|||
|
")";
|
|||
|
cmd.ExecuteNonQuery();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|