Fix SQLx database migration
This commit is contained in:
parent
42aba64bc2
commit
754cac54e2
|
|
@ -1,3 +1,2 @@
|
|||
backend/target
|
||||
backend/db
|
||||
backend/db/db.sqlite3
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
-- Add migration script here
|
||||
CREATE TABLE IF NOT EXISTS accounts (
|
||||
user_id serial primary key,
|
||||
created_on timestamp not null,
|
||||
last_login timestamp,
|
||||
last_name varchar(50) not null,
|
||||
first_name varchar(50) not null,
|
||||
discord_id varchar(50),
|
||||
discord_avatar varchar(255),
|
||||
discord_username varchar(50),
|
||||
discord_discriminator varchar(50)
|
||||
);
|
||||
|
|
@ -0,0 +1 @@
|
|||
-- Add down migration script here
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
-- Add up migration script here
|
||||
CREATE TABLE "oauth2_state_storage" (
|
||||
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"csrf_state" text NOT NULL,
|
||||
"pkce_code_verifier" text NOT NULL,
|
||||
"return_url" text NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "user_sessions" (
|
||||
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" integer NOT NULL,
|
||||
"session_token_p1" text NOT NULL,
|
||||
"session_token_p2" text NOT NULL,
|
||||
"created_at" integer NOT NULL,
|
||||
"expires_at" integer NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "users" (
|
||||
"id" integer NOT NULL,
|
||||
"email" text NOT NULL UNIQUE,
|
||||
"name" text NOT NULL,
|
||||
"family_name" text NOT NULL,
|
||||
"given_name" text NOT NULL,
|
||||
PRIMARY KEY("id" AUTOINCREMENT)
|
||||
);
|
||||
|
|
@ -114,7 +114,7 @@ async fn index<T>(
|
|||
Extension(user_data): Extension<Option<UserData>>,
|
||||
_request: Request<T>,
|
||||
) -> impl IntoResponse {
|
||||
let user_email = user_data.map(|s| s.email);
|
||||
let user_email = user_data.map(|s| s.name);
|
||||
let logged_in = user_email.is_some();
|
||||
let name = user_email.unwrap_or_default();
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
<p>This will be the private information area for the extended Jean-Marie family.</p>
|
||||
<div>
|
||||
<h2>Web links</h2>
|
||||
<h3>TLC Creations</h3>
|
||||
<ul>
|
||||
<li><a href="https://www.tlccreations.ca">TLC Creations</a></li>
|
||||
</ul>
|
||||
<h3>Fonts</h3>
|
||||
<ul>
|
||||
<li><a href="https://fonts.google.com">Google fonts</a></li>
|
||||
|
|
@ -31,21 +35,21 @@
|
|||
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active">
|
||||
<img src="assets/images/slide-01.jpg" alt="View from the dock" class="d-block w-100">
|
||||
<img src="assets/images/slide-01.jpg" alt="View from the dock" class="d-block w-50">
|
||||
<div class="carousel-caption">
|
||||
<h3>Jean-Marie Family</h3>
|
||||
<p>View from the dock</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="assets/images/slide-02.jpg" alt="Sunset at 3 sisters" class="d-block w-100">
|
||||
<img src="assets/images/slide-02.jpg" alt="Sunset at 3 sisters" class="d-block w-50">
|
||||
<div class="carousel-caption">
|
||||
<h3>Jean-Marie Family</h3>
|
||||
<p>Sunset over the 3 sisters</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="assets/images/slide-03.jpg" alt="Purple sunset" class="d-block w-100">
|
||||
<img src="assets/images/slide-03.jpg" alt="Purple sunset" class="d-block w-50">
|
||||
<div class="carousel-caption">
|
||||
<h3>Jean-Marie Family</h3>
|
||||
<p>Purple sunset</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue