aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-04-28 23:08:04 +0000
committerFuwn <[email protected]>2021-04-28 23:08:04 +0000
commit7c77538dcec1cf7fc779e0c5c2e33a9fc0b6e590 (patch)
tree33fa38ad9f8460a074d7b09f52ef4a45f7b1a97b
parentMerge pull request #9 from Whirlsplash/renovate/rust-sqlx-0.x (diff)
downloadwhirl-7c77538dcec1cf7fc779e0c5c2e33a9fc0b6e590.tar.xz
whirl-7c77538dcec1cf7fc779e0c5c2e33a9fc0b6e590.zip
fmt: Increase verbosity of database migrations
-rw-r--r--.env4
-rw-r--r--migrations/20210322015725_serial_numbers.down.sql1
-rw-r--r--migrations/20210322015725_serial_numbers.sql5
-rw-r--r--migrations/20210322015725_serial_numbers.up.sql5
-rw-r--r--migrations/20210322015732_user_registration.down.sql1
-rw-r--r--migrations/20210322015732_user_registration.sql12
-rw-r--r--migrations/20210322015732_user_registration.up.sql12
-rw-r--r--migrations/20210322015737_user_properties.down.sql1
-rw-r--r--migrations/20210322015737_user_properties.sql8
-rw-r--r--migrations/20210322015737_user_properties.up.sql8
-rw-r--r--shell.nix2
11 files changed, 34 insertions, 25 deletions
diff --git a/.env b/.env
new file mode 100644
index 0000000..18c3d24
--- /dev/null
+++ b/.env
@@ -0,0 +1,4 @@
+# This file is *mostly* just a backup for environment variables in case Nix is
+# either not working or you just don't want to use it. :)
+
+DATABASE_URl=sqlite:whirl.db
diff --git a/migrations/20210322015725_serial_numbers.down.sql b/migrations/20210322015725_serial_numbers.down.sql
new file mode 100644
index 0000000..9b64755
--- /dev/null
+++ b/migrations/20210322015725_serial_numbers.down.sql
@@ -0,0 +1 @@
+DROP TABLE serial_numbers
diff --git a/migrations/20210322015725_serial_numbers.sql b/migrations/20210322015725_serial_numbers.sql
deleted file mode 100644
index dd140a9..0000000
--- a/migrations/20210322015725_serial_numbers.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-CREATE TABLE "serial_numbers" (
- "serial_number" TEXT NOT NULL UNIQUE,
- "user_name" TEXT NOT NULL,
- "serial_status" TEXT NOT NULL
-);
diff --git a/migrations/20210322015725_serial_numbers.up.sql b/migrations/20210322015725_serial_numbers.up.sql
new file mode 100644
index 0000000..b0c1895
--- /dev/null
+++ b/migrations/20210322015725_serial_numbers.up.sql
@@ -0,0 +1,5 @@
+CREATE TABLE serial_numbers (
+ serial_number TEXT NOT NULL UNIQUE,
+ user_name TEXT NOT NULL,
+ serial_status TEXT NOT NULL
+)
diff --git a/migrations/20210322015732_user_registration.down.sql b/migrations/20210322015732_user_registration.down.sql
new file mode 100644
index 0000000..5bc3c0e
--- /dev/null
+++ b/migrations/20210322015732_user_registration.down.sql
@@ -0,0 +1 @@
+DROP TABLE user_registration
diff --git a/migrations/20210322015732_user_registration.sql b/migrations/20210322015732_user_registration.sql
deleted file mode 100644
index 6f00d75..0000000
--- a/migrations/20210322015732_user_registration.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-CREATE TABLE "user_registration" (
- "user_name_lower" TEXT NOT NULL,
- "user_name" TEXT NOT NULL,
- "serial_number" TEXT NOT NULL,
- "password" TEXT NOT NULL,
- "client_version" TEXT NOT NULL,
- "account_status" INTEGER NOT NULL,
- "registration_date" TEXT NOT NULL,
- "times_on" INTEGER NOT NULL,
- "total_minutes" INTEGER NOT NULL,
- "user_privileges" INTEGER NOT NULL
-);
diff --git a/migrations/20210322015732_user_registration.up.sql b/migrations/20210322015732_user_registration.up.sql
new file mode 100644
index 0000000..6a76e9b
--- /dev/null
+++ b/migrations/20210322015732_user_registration.up.sql
@@ -0,0 +1,12 @@
+CREATE TABLE user_registration (
+ user_name_lower TEXT NOT NULL,
+ user_name TEXT NOT NULL,
+ serial_number TEXT NOT NULL,
+ password TEXT NOT NULL,
+ client_version TEXT NOT NULL,
+ account_status INTEGER NOT NULL,
+ registration_date TEXT NOT NULL,
+ times_on INTEGER NOT NULL,
+ total_minutes INTEGER NOT NULL,
+ user_privileges INTEGER NOT NULL
+)
diff --git a/migrations/20210322015737_user_properties.down.sql b/migrations/20210322015737_user_properties.down.sql
new file mode 100644
index 0000000..6b03c94
--- /dev/null
+++ b/migrations/20210322015737_user_properties.down.sql
@@ -0,0 +1 @@
+DROP TABLE user_properties
diff --git a/migrations/20210322015737_user_properties.sql b/migrations/20210322015737_user_properties.sql
deleted file mode 100644
index a202ec1..0000000
--- a/migrations/20210322015737_user_properties.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE TABLE "user_properties" (
- "user_name" TEXT NOT NULL,
- "property_id" INTEGER NOT NULL,
- "property_flags" INTEGER NOT NULL,
- "property_access" INTEGER NOT NULL,
- "property_string_value" TEXT,
- "property_binary_value" TEXT
-);
diff --git a/migrations/20210322015737_user_properties.up.sql b/migrations/20210322015737_user_properties.up.sql
new file mode 100644
index 0000000..fe43761
--- /dev/null
+++ b/migrations/20210322015737_user_properties.up.sql
@@ -0,0 +1,8 @@
+CREATE TABLE user_properties (
+ user_name TEXT NOT NULL,
+ property_id INTEGER NOT NULL,
+ property_flags INTEGER NOT NULL,
+ property_access INTEGER NOT NULL,
+ property_string_value TEXT,
+ property_binary_value TEXT
+)
diff --git a/shell.nix b/shell.nix
index 4873647..481cbc6 100644
--- a/shell.nix
+++ b/shell.nix
@@ -5,4 +5,6 @@ let
in
pkgs.mkShell {
buildInputs = with pkgs; [ rust ];
+
+ DATABASE_URL = "sqlite:whirl.db";
}