Archive:Website Documentation/Database Schema

Apologies for it being a Ruby but here is my schema for the chapters database. It also begins to define a good CRM for Contacts.

create_table "chapters" do |t| t.column "name", :string, :limit => 80, :null => false t.column "subdomain", :string, :limit => 10 t.column "uri", :string, :limit => 80 t.column "blog", :string, :limit => 80 t.column "wiki", :string, :limit => 80 t.column "mailinglist", :string, :limit => 80 t.column "members", :integer, :default => 0 t.column "coremembers", :integer, :default => 0 t.column "budget", :boolean, :default => false t.column "budgetsize", :integer, :default => 0 t.column "ship_fc_shirts", :boolean, :default => false t.column "paid_fc_shirts", :integer t.column "ship_cc", :boolean, :default => false t.column "ship_eff", :boolean, :default => false t.column "ship_pk", :boolean, :default => false t.column "school_id", :integer, :null => false, :default => 0 # => foreign key t.column "contact_id" :integer, :null => false, :default => 0 # => foreign key t.column "is_approved", :boolean, :default => false t.column "is_active", :boolean, :default => false t.column "registered", :date, :null => false t.column "created_at", :datetime, :null => false t.column "modified_at", :datetime, :null => false end

create_table "schools" do |t| t.column "name", :string, :limit => 80, :null => false t.column "address", :string, :limit => 60 t.column "address2", :string, :limit => 60 t.column "city", :string, :limit => 40 t.column "state", :string, :limit => 2 t.column "zip", :string, :limit => 5 t.column "plus4", :string, :limit => 4, :default => "" t.column "uri", :string, :limit => 80 t.column "latitude", :float t.column "longitude", :float t.column "created_at", :datetime, :null => false t.column "modified_at", :datetime, :null => false end

create_table "contacts" do |t| t.column "firstname", :string, :limit => 40, :null => false t.column "lastname", :string, :limit => 40, :null => false t.column "address", :string, :limit => 60 t.column "address2", :string, :limit => 60 t.column "city", :string, :limit => 40 t.column "state", :string, :limit => 2 t.column "zip", :string, :limit => 5 t.column "plus4", :string, :limit => 4, :default => "" t.column "email", :string, :limit => 60, :null => false t.column "aim", :string, :limit => 20 t.column "jabber", :string, :limit => 60 t.column "mobile", :string, :limit => 10 t.column "nonmobile", :string, :limit => 10 t.column "jabber", :string, :limit => 60 t.column "created_at", :datetime, :null => false t.column "modified_at", :datetime, :null => false end

create_table "sizes" do |t| t.column "size", :string, :limit => 10, :null => false t.column "num_available", :integer, :null => false, :default => 0 t.column "on_order", :boolean, :default => false end