fix: use raw_sql instead of .execute
This commit is contained in:
parent
0f1824b366
commit
799a1ff49e
1 changed files with 16 additions and 9 deletions
25
src/main.rs
25
src/main.rs
|
@ -26,15 +26,22 @@ async fn main() -> Result<(), Error> {
|
||||||
TODO: Figure out if a table should be used here and if not then what.
|
TODO: Figure out if a table should be used here and if not then what.
|
||||||
Also figure out if these should be different types from what they currently are and if we should add more "constraints"
|
Also figure out if these should be different types from what they currently are and if we should add more "constraints"
|
||||||
*/
|
*/
|
||||||
pool.execute(r#"CREATE TABLE IF NOT EXISTS users (
|
sqlx::raw_sql(r#"
|
||||||
uuid uuid UNIQUE NOT NULL,
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
username varchar(32) UNIQUE NOT NULL,
|
uuid uuid PRIMARY KEY UNIQUE NOT NULL,
|
||||||
display_name varchar(64),
|
username varchar(32) UNIQUE NOT NULL,
|
||||||
password varchar(512) NOT NULL,
|
display_name varchar(64),
|
||||||
email varchar(100) UNIQUE NOT NULL,
|
password varchar(512) NOT NULL,
|
||||||
email_verified integer NOT NULL DEFAULT '0',
|
email varchar(100) UNIQUE NOT NULL,
|
||||||
PRIMARY KEY (uuid)
|
email_verified boolean NOT NULL DEFAULT FALSE
|
||||||
)"#).await?;
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS instance_permissions (
|
||||||
|
uuid uuid REFERENCES users(uuid),
|
||||||
|
administrator boolean NOT NULL DEFAULT FALSE
|
||||||
|
)
|
||||||
|
"#)
|
||||||
|
.execute(&pool)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let data = Data {
|
let data = Data {
|
||||||
pool,
|
pool,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue