· 8 years ago · Apr 07, 2018, 04:06 PM
1#
2# dbtables.sql
3#
4# Simplifies the task of creating all the database tables
5# used by the login system.
6#
7# Can be run from command prompt by typing:
8#
9# mysql -u yourusername -D yourdatabasename < dbtables.sql
10#
11
12drop database if exists voidvalidations;
13create database voidvalidations;
14use voidvalidations;
15
16# Table structure for users table
17#
18DROP TABLE IF EXISTS Users;
19
20CREATE TABLE users (
21 uID int(7) auto_increment,
22 uLogin varchar(30) not null,
23 uFirst varchar(75) not null,
24 uLast varchar(40) not null,
25 uAge tinyint(2) not null,
26 uBirthdate date not null,
27 uEmail varchar(40) not null,
28 uPassword varchar(32) not null,
29 uGID int(5) not null,
30 uRegDate date not null,
31 uLastVisit date not null,
32 uActivation int(1) not null default 0,
33 uLocation varchar(40) not null,
34 uBanned int(1) not null default 0,
35 uTimestamp time,
36 uSendEmail tinyint(1) not null default 1,
37 uFileAccess tinyint(1) not null default 0,
38);
39
40
41#
42# Table structure for active users table
43#
44DROP TABLE IF EXISTS active_users;
45
46CREATE TABLE active_users (
47 username varchar(30) primary key,
48 timestamp int(11) unsigned not null
49);
50
51
52#
53# Table structure for active guests table
54#
55DROP TABLE IF EXISTS active_guests;
56
57CREATE TABLE active_guests (
58 ip varchar(15) primary key,
59 timestamp int(11) unsigned not null
60);