Skip to content

Commit

Permalink
feat: updates necessary tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshnirmalya committed Jul 26, 2020
1 parent f480ff0 commit 10699ec
Show file tree
Hide file tree
Showing 16 changed files with 7,029 additions and 43 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."users";
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE "public"."users"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" varchar NOT NULL, "email" varchar NOT NULL, "email_verified" timestamptz, "image" bpchar, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"));
CREATE TABLE "public"."users"("id" serial NOT NULL, "name" varchar, "email" varchar NOT NULL, "email_verified" timestamptz, "image" varchar, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"));
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
RETURNS TRIGGER AS $$
DECLARE
Expand All @@ -16,4 +14,4 @@ BEFORE UPDATE ON "public"."users"
FOR EACH ROW
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
COMMENT ON TRIGGER "set_public_users_updated_at" ON "public"."users"
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."accounts";
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE "public"."accounts"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "compound_id" varchar NOT NULL, "user_id" uuid NOT NULL, "provider_type" varchar NOT NULL, "provider_id" varchar NOT NULL, "provider_account_id" varchar NOT NULL, "refresh_token" text, "access_token" text, "access_token_expires" timestamptz, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") );
CREATE TABLE "public"."accounts"("id" serial NOT NULL, "compound_id" varchar NOT NULL, "user_id" integer NOT NULL, "provider_type" varchar NOT NULL, "provider_id" varchar NOT NULL, "provider_account_id" varchar NOT NULL, "refresh_token" text, "access_token" text, "access_token_expires" timestamptz, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"));
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
RETURNS TRIGGER AS $$
DECLARE
Expand All @@ -16,4 +14,4 @@ BEFORE UPDATE ON "public"."accounts"
FOR EACH ROW
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
COMMENT ON TRIGGER "set_public_accounts_updated_at" ON "public"."accounts"
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."sessions";
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE "public"."sessions"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "user_id" uuid NOT NULL, "expires" timestamptz NOT NULL, "session_token" varchar NOT NULL, "access_token" varchar NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") );
CREATE TABLE "public"."sessions"("id" serial NOT NULL, "user_id" integer NOT NULL, "expires" timestamptz NOT NULL, "session_token" varchar NOT NULL, "access_token" varchar NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"));
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
RETURNS TRIGGER AS $$
DECLARE
Expand All @@ -16,4 +14,4 @@ BEFORE UPDATE ON "public"."sessions"
FOR EACH ROW
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
COMMENT ON TRIGGER "set_public_sessions_updated_at" ON "public"."sessions"
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."verification_requests";
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE "public"."verification_requests"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "identifier" varchar NOT NULL, "token" varchar NOT NULL, "expires" timestamptz NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"));
CREATE TABLE "public"."verification_requests"("id" serial NOT NULL, "identifier" varchar NOT NULL, "token" varchar NOT NULL, "expires" timestamptz NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"));
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
RETURNS TRIGGER AS $$
DECLARE
Expand All @@ -16,4 +14,4 @@ BEFORE UPDATE ON "public"."verification_requests"
FOR EACH ROW
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
COMMENT ON TRIGGER "set_public_verification_requests_updated_at" ON "public"."verification_requests"
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
14 changes: 0 additions & 14 deletions backend/migrations/metadata.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions frontend/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { NextApiRequest, NextApiResponse } from "next";

interface iToken {
email: string;
name: string;
picture: string;
name?: string;
picture?: string;
}

const client = new Client({
Expand All @@ -17,9 +17,9 @@ const client = new Client({
const options = {
site: process.env.VERCEL_URL,
providers: [
Providers.Google({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
Providers.Email({
server: process.env.EMAIL_SERVER,
from: process.env.EMAIL_FROM,
}),
],
database: process.env.DATABASE_URL,
Expand Down
28 changes: 28 additions & 0 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"*": ["/*"],
"components/*": ["components/*"],
"lib/*": ["lib/*"],
"pages/*": ["pages/*"],
"types/*": ["types/*"],
"configs/*": ["configs/*"]
},
"strict": false,
"forceConsistentCasingInFileNames": true
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
Loading

0 comments on commit 10699ec

Please sign in to comment.