-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
161 changed files
with
2,936 additions
and
1,867 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
examples/hackathon-submissions/migrations/20231214123430_new_auth/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- CreateTable | ||
CREATE TABLE "Submission" ( | ||
"name" TEXT NOT NULL, | ||
"email" TEXT NOT NULL, | ||
"github" TEXT NOT NULL, | ||
"description" TEXT NOT NULL, | ||
"twitter" TEXT, | ||
"country" TEXT, | ||
"website" TEXT, | ||
"image" TEXT, | ||
"approved" BOOLEAN NOT NULL DEFAULT false, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "Submission_pkey" PRIMARY KEY ("name") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Submission_name_key" ON "Submission"("name"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Submission_email_key" ON "Submission"("email"); |
3 changes: 3 additions & 0 deletions
3
examples/hackathon-submissions/migrations/migration_lock.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
examples/thoughts/migrations/20210513205603_/migration.sql
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
examples/thoughts/migrations/20210713180928_attached_entities_to_user/migration.sql
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
examples/thoughts/migrations/20210713182512_tags_unique/migration.sql
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
examples/thoughts/migrations/20220818151104_rename_email_to_username/migration.sql
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
examples/thoughts/migrations/20220818165835_getting_up_to_date/migration.sql
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
examples/thoughts/migrations/20231214130619_new_auth/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Thought" ( | ||
"id" SERIAL NOT NULL, | ||
"textMarkdown" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Thought_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Tag" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Tag_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Auth" ( | ||
"id" TEXT NOT NULL, | ||
"userId" INTEGER, | ||
|
||
CONSTRAINT "Auth_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "AuthIdentity" ( | ||
"providerName" TEXT NOT NULL, | ||
"providerUserId" TEXT NOT NULL, | ||
"providerData" TEXT NOT NULL DEFAULT '{}', | ||
"authId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "AuthIdentity_pkey" PRIMARY KEY ("providerName","providerUserId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_TagToThought" ( | ||
"A" INTEGER NOT NULL, | ||
"B" INTEGER NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Tag_name_userId_key" ON "Tag"("name", "userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Auth_userId_key" ON "Auth"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_TagToThought_AB_unique" ON "_TagToThought"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_TagToThought_B_index" ON "_TagToThought"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Thought" ADD CONSTRAINT "Thought_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Tag" ADD CONSTRAINT "Tag_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Auth" ADD CONSTRAINT "Auth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "AuthIdentity" ADD CONSTRAINT "AuthIdentity_authId_fkey" FOREIGN KEY ("authId") REFERENCES "Auth"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_TagToThought" ADD CONSTRAINT "_TagToThought_A_fkey" FOREIGN KEY ("A") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_TagToThought" ADD CONSTRAINT "_TagToThought_B_fkey" FOREIGN KEY ("B") REFERENCES "Thought"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
|
||
import logout from '@wasp/auth/logout' | ||
import logout from "@wasp/auth/logout"; | ||
|
||
import './TopNavbar.css' | ||
import "./TopNavbar.css"; | ||
|
||
import { getUsername } from "@wasp/auth/user"; | ||
|
||
const TopNavbar = (props) => { | ||
const user = props.user | ||
const TopNavbar = ({ user }) => { | ||
const username = getUsername(user); | ||
|
||
return ( | ||
<div className="top-navbar"> | ||
{ user.username } | ||
{username} | ||
| | ||
<button className="plain" onClick={logout}> logout </button> | ||
<button className="plain" onClick={logout}> | ||
{" "} | ||
logout{" "} | ||
</button> | ||
</div> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default TopNavbar | ||
export default TopNavbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
examples/todo-typescript/migrations/20231012121747_initial/migration.sql
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
examples/todo-typescript/migrations/20231214130914_new_auth/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Task" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"description" TEXT NOT NULL, | ||
"isDone" BOOLEAN NOT NULL DEFAULT false, | ||
"userId" INTEGER NOT NULL, | ||
CONSTRAINT "Task_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Auth" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"userId" INTEGER, | ||
CONSTRAINT "Auth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "AuthIdentity" ( | ||
"providerName" TEXT NOT NULL, | ||
"providerUserId" TEXT NOT NULL, | ||
"providerData" TEXT NOT NULL DEFAULT '{}', | ||
"authId" TEXT NOT NULL, | ||
|
||
PRIMARY KEY ("providerName", "providerUserId"), | ||
CONSTRAINT "AuthIdentity_authId_fkey" FOREIGN KEY ("authId") REFERENCES "Auth" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Auth_userId_key" ON "Auth"("userId"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
examples/tutorials/TodoApp/migrations/20220113204751_init/migration.sql
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
examples/tutorials/TodoApp/migrations/20220818151104_rename_email_to_username/migration.sql
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
examples/tutorials/TodoApp/migrations/20220818170255_getting_up_to_date/migration.sql
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.