diff --git a/lib/src/database/mod.rs b/lib/src/database/mod.rs old mode 100644 new mode 100755 index fe02de8..5f10c29 --- a/lib/src/database/mod.rs +++ b/lib/src/database/mod.rs @@ -65,6 +65,11 @@ impl Driver { .port(options.port); let pool = MySqlPool::connect_with(opts).await?; + + sqlx::query(include_str!("skins.sql")) + .execute(&mut *pool.acquire().await?) + .await?; + Ok(Self::Mysql(pool)) } @@ -77,6 +82,11 @@ impl Driver { .port(options.port); let pool = PgPool::connect_with(opts).await?; + sqlx::query(include_str!("skins.sql")) + .execute(&mut *pool.acquire().await?) + .await?; + + Ok(Self::Postgres(pool)) } @@ -84,6 +94,11 @@ impl Driver { let opts = SqliteConnectOptions::new().filename(path); let pool = SqlitePool::connect_with(opts).await?; + sqlx::query(include_str!("skins.sql")) + .execute(&mut *pool.acquire().await?) + .await?; + + Ok(Self::Sqlite(pool)) } diff --git a/lib/src/database/profile.rs b/lib/src/database/profile.rs old mode 100644 new mode 100755 diff --git a/lib/src/database/skins.sql b/lib/src/database/skins.sql new file mode 100644 index 0000000..a3efac5 --- /dev/null +++ b/lib/src/database/skins.sql @@ -0,0 +1,5 @@ +CREATE TABLE skins ( + uuid TEXT NOT NULL PRIMARY KEY, + value TEXT NOT NULL, + signature TEXT NOT NULL +); \ No newline at end of file