Instant Framework Demo

Database generator script for the Budget Database product

This is a standard SQL generator file used to create a product's database. This example creates the database behind the Budget Server product.

Instant Framework allows a developer to rapidly create a direct web interface atop the underlying database, by cutting and pasting Instant Framework screens that work directly on these tables. Because Instant Framework screens are small and easily modified, the interface can be built very quickly. An interface can be built atop any database, including a the datbase from an existing product or business system.

Soon the Instant Framework will read an SQL file like this and generate the complete web interface itself, so the developer need only customize it.

# This is the generator file for an Instant Framework email demo 
# database.
# BE CAREFUL - running this script deletes any existing tables
# and their contents!

use davidr1

drop table if exists message;
create table message
(
  message_id MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
  subject VARCHAR(40) NULL,
  sender_id MEDIUMINT NOT NULL,
  sent_date_time DATETIME NOT NULL,
  text VARCHAR(255) NULL
);

drop table if exists recipient_list;
create table recipient_list
(
  recipient_list_id MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
  message_id  MEDIUMINT NOT NULL,
  recipient_id MEDIUMINT NOT NULL,
  type ENUM('To', 'CC', 'BCC'),
  was_read ENUM('Read', 'Not Read')
);

drop table if exists attachment;
create table attachment
(
  attachment_id MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
  message_id  MEDIUMINT NOT NULL,
  file_path VARCHAR(120) NULL
);

drop table if exists mailbox;
create table mailbox
(
  mailbox_id MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
  emperson_id  MEDIUMINT NOT NULL,
  mailbox_name VARCHAR(40) NULL
);

drop table if exists emperson;
create table emperson
(
  emperson_id MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
  login_id CHAR(8) NOT NULL,
  first_name VARCHAR(40) NOT NULL,
  last_name VARCHAR(40) NOT NULL,
  email VARCHAR(40) NULL,
  password VARCHAR(20) NOT NULL,
  role ENUM('Account Exec', 'Sales Manager', 'Administrator') NOT NULL
);
create index i_emperson_login_id on emperson(login_id);