# This file is autogenerated. Instead of editing this file, please use the # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. ActiveRecord::Schema.define(:version => 30) do create_table "absences", :force => true do |t| t.column "user_id", :integer, :null => false t.column "on", :date, :null => false t.column "reason", :string, :null => false end create_table "backlogs", :force => true do |t| t.column "name", :string, :limit => 64, :null => false t.column "track_todo", :boolean t.column "enable_subtasks", :boolean, :default => false, :null => false t.column "enable_customer", :boolean t.column "enable_users", :boolean t.column "work_account_id", :integer t.column "customer_id", :integer t.column "enable_periods", :boolean end create_table "configurations", :force => true do |t| t.column "time_keeper", :boolean end create_table "customers", :force => true do |t| t.column "name", :string, :limit => 64, :null => false end create_table "estimates", :force => true do |t| t.column "task_id", :integer, :null => false t.column "todo", :decimal, :precision => 6, :scale => 2, :default => 1.0, :null => false t.column "created_at", :datetime, :null => false t.column "user_id", :integer end add_index "estimates", ["task_id", "created_at"], :name => "index_estimates_on_task_id_and_created_at" create_table "groups", :primary_key => "party_id", :force => true do |t| t.column "name", :string, :null => false end create_table "groups_users", :id => false, :force => true do |t| t.column "group_id", :integer, :null => false t.column "user_id", :integer, :null => false end add_index "groups_users", ["group_id", "user_id"], :name => "index_groups_users_on_group_id_and_user_id", :unique => true create_table "parties", :force => true do |t| t.column "type", :string end create_table "periods", :force => true do |t| t.column "position", :integer, :null => false t.column "start_on", :date, :null => false t.column "end_on", :date, :null => false t.column "party_id", :integer end create_table "public_holidays", :force => true do |t| t.column "on", :date, :null => false end create_table "task_files", :force => true do |t| t.column "task_id", :integer, :null => false t.column "name", :string, :limit => 64, :null => false t.column "content_type", :string, :null => false t.column "content_data", :binary, :null => false end create_table "tasks", :force => true do |t| t.column "position", :integer t.column "description", :string, :limit => 80, :null => false t.column "finished_at", :datetime t.column "initial_estimate", :decimal, :precision => 6, :scale => 2, :default => 1.0, :null => false t.column "period_id", :integer t.column "created_at", :datetime t.column "parent_id", :integer t.column "resolution", :string, :limit => 16 t.column "previous_task_id", :integer t.column "backlog_id", :integer t.column "notes", :text t.column "work_account_id", :integer t.column "customer_id", :integer t.column "created_by", :integer t.column "updated_by", :integer t.column "updated_at", :datetime end add_index "tasks", ["parent_id"], :name => "index_tasks_on_parent_id" create_table "tasks_users", :id => false, :force => true do |t| t.column "task_id", :integer, :null => false t.column "user_id", :integer, :null => false end create_table "user_work_lock_subscriptions", :id => false, :force => true do |t| t.column "subscriber_user_id", :integer, :null => false t.column "user_id", :integer, :null => false end create_table "users", :primary_key => "party_id", :force => true do |t| t.column "login", :string, :limit => 80, :null => false t.column "salted_password", :string, :limit => 40, :null => false t.column "email", :string, :limit => 60, :null => false t.column "first_name", :string, :limit => 40 t.column "last_name", :string, :limit => 40 t.column "salt", :string, :limit => 40, :null => false t.column "verified", :boolean, :default => false t.column "role", :string, :limit => 40 t.column "security_token", :string, :limit => 40 t.column "token_expiry", :datetime t.column "deleted", :boolean, :default => false end create_table "work_accounts", :force => true do |t| t.column "name", :string, :limit => 64, :null => false t.column "track_times", :boolean t.column "invoice_code", :string end create_table "work_lock_subscriptions", :id => false, :force => true do |t| t.column "subscriber_user_id", :integer, :null => false t.column "work_account_id", :integer, :null => false end create_table "work_locks", :force => true do |t| t.column "user_id", :integer, :null => false t.column "start_on", :date, :null => false t.column "end_on", :date, :null => false end create_table "works", :force => true do |t| t.column "task_id", :integer t.column "hours", :decimal, :precision => 6, :scale => 2, :default => 0.0, :null => false t.column "completed_at", :datetime t.column "user_id", :integer t.column "invoice", :boolean t.column "work_account_id", :integer t.column "customer_id", :integer t.column "description", :string t.column "started_on", :date, :null => false t.column "start_time", :time t.column "notes", :text end add_index "works", ["task_id", "completed_at"], :name => "index_works_on_task_id_and_completed_at" add_foreign_key "absences", ["user_id"], "users", ["party_id"], :name => "absences_user_id_fkey" add_foreign_key "backlogs", ["customer_id"], "customers", ["id"], :name => "backlogs_customer_id_fkey" add_foreign_key "backlogs", ["work_account_id"], "work_accounts", ["id"], :name => "backlogs_work_account_id_fkey" add_foreign_key "estimates", ["user_id"], "users", ["party_id"], :name => "estimates_user_id_fkey" add_foreign_key "estimates", ["task_id"], "tasks", ["id"], :name => "estimates_task_id_fkey" add_foreign_key "groups", ["party_id"], "parties", ["id"], :name => "groups_party_id_fkey" add_foreign_key "groups_users", ["user_id"], "users", ["party_id"], :name => "groups_users_user_id_fkey" add_foreign_key "groups_users", ["group_id"], "groups", ["party_id"], :name => "groups_users_group_id_fkey" add_foreign_key "periods", ["party_id"], "parties", ["id"], :name => "periods_party_id_fkey" add_foreign_key "task_files", ["task_id"], "tasks", ["id"], :name => "task_files_task_id_fkey" add_foreign_key "tasks", ["updated_by"], "users", ["party_id"], :name => "tasks_updated_by_fkey" add_foreign_key "tasks", ["created_by"], "users", ["party_id"], :name => "tasks_created_by_fkey" add_foreign_key "tasks", ["customer_id"], "customers", ["id"], :name => "tasks_customer_id_fkey" add_foreign_key "tasks", ["work_account_id"], "work_accounts", ["id"], :name => "tasks_work_account_id_fkey" add_foreign_key "tasks", ["backlog_id"], "backlogs", ["id"], :name => "tasks_backlog_id_fkey" add_foreign_key "tasks", ["previous_task_id"], "tasks", ["id"], :name => "tasks_previous_task_id_fkey" add_foreign_key "tasks", ["parent_id"], "tasks", ["id"], :name => "tasks_parent_id_fkey" add_foreign_key "tasks", ["period_id"], "periods", ["id"], :name => "tasks_period_id_fkey" add_foreign_key "tasks_users", ["task_id"], "tasks", ["id"], :name => "tasks_users_task_id_fkey" add_foreign_key "tasks_users", ["user_id"], "users", ["party_id"], :name => "tasks_users_user_id_fkey" add_foreign_key "user_work_lock_subscriptions", ["subscriber_user_id"], "users", ["party_id"], :name => "user_work_lock_subscriptions_subscriber_user_id_fkey" add_foreign_key "user_work_lock_subscriptions", ["user_id"], "users", ["party_id"], :name => "user_work_lock_subscriptions_user_id_fkey" add_foreign_key "users", ["party_id"], "parties", ["id"], :name => "users_party_id_fkey" add_foreign_key "work_lock_subscriptions", ["subscriber_user_id"], "users", ["party_id"], :name => "work_lock_subscriptions_subscriber_user_id_fkey" add_foreign_key "work_lock_subscriptions", ["work_account_id"], "work_accounts", ["id"], :name => "work_lock_subscriptions_work_account_id_fkey" add_foreign_key "work_locks", ["user_id"], "users", ["party_id"], :name => "work_locks_user_id_fkey" add_foreign_key "works", ["work_account_id"], "work_accounts", ["id"], :name => "works_work_account_id_fkey" add_foreign_key "works", ["customer_id"], "customers", ["id"], :name => "works_customer_id_fkey" add_foreign_key "works", ["user_id"], "users", ["party_id"], :name => "works_user_id_fkey" add_foreign_key "works", ["task_id"], "tasks", ["id"], :name => "works_task_id_fkey" end