awdriggs / friendlywager Goto Github PK
View Code? Open in Web Editor NEWForum with ability to set wagers on when events will happen
Forum with ability to set wagers on when events will happen
Can't delete a topic because it violates foreign key requirements.
This is what I have in my schema. Do I need to add something inside the drop table to to delete dependents?
DROP TABLE IF EXISTS topics CASCADE;
DROP TABLE IF EXISTS wagers;
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS comments;
DROP TABLE IF EXISTS tags CASCADE;
DROP TABLE IF EXISTS tags_topics;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(255),
first VARCHAR(255),
last VARCHAR(255),
password VARCHAR(255),
img_url TEXT,
points INTEGER DEFAULT(0) NOT NULL
);
CREATE TABLE tags (
id SERIAL PRIMARY KEY,
keyword VARCHAR(25)
);
CREATE TABLE topics (
id SERIAL PRIMARY KEY,
title VARCHAR(255),
description TEXT,
creation_date TIMESTAMP without time zone DEFAULT now() NOT NULL,
active BOOLEAN DEFAULT true,
complete_date TIMESTAMP without time zone,
winner_id INTEGER references users,
owner_id INTEGER references users,
geo_id VARCHAR(255),
city VARCHAR(255),
region VARCHAR(255),
country VARCHAR(255)
);
CREATE TABLE wagers (
id SERIAL PRIMARY KEY,
topic_id INTEGER references topics,
user_id INTEGER references users,
creation_date TIMESTAMP without time zone DEFAULT now() NOT NULL,
wager TIMESTAMP NOT NULL,
geo_id VARCHAR(255),
city VARCHAR(255),
region VARCHAR(255),
country VARCHAR(255)
);
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
topic_id INTEGER references topics,
user_id INTEGER references users,
creation_date TIMESTAMP without time zone DEFAULT now() NOT NULL,
geo_id VARCHAR(255),
city VARCHAR(255),
region VARCHAR(255),
country VARCHAR(255),
comment TEXT
);
CREATE TABLE tags_topics (
tag_id INTEGER references tags,
topic_id INTEGER references topics
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.