# 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 => 494) do create_table "account_authorizations", :force => true do |t| t.column "account_id", :integer t.column "expires_at", :datetime t.column "payment_id", :integer t.column "created_at", :datetime t.column "updated_at", :datetime end create_table "accounts", :force => true do |t| t.column "party_id", :integer t.column "created_at", :datetime t.column "updated_at", :datetime t.column "expires_at", :datetime t.column "options", :text t.column "master", :boolean, :default => false, :null => false t.column "title", :string t.column "last_paid_at", :datetime t.column "payment_plan_id", :integer, :limit => 8 t.column "confirmation_token_expires_at", :datetime t.column "confirmation_token", :string end create_table "asset_authorizations", :force => true do |t| t.column "attachment_id", :integer, :null => false t.column "email", :string t.column "name", :string t.column "expires_at", :datetime t.column "private_key", :string t.column "url_hash", :string, :default => "", :null => false t.column "cookie_hash", :string t.column "cookie_instantiation_count", :integer, :default => 0, :null => false t.column "download_count", :integer, :default => 0, :null => false t.column "unauthorized_access_attempts_count", :integer, :default => 0, :null => false t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "account_id", :integer t.column "type", :string end add_index "asset_authorizations", ["cookie_hash"], :name => "by_cookie_hash", :unique => true add_index "asset_authorizations", ["url_hash", "email"], :name => "by_url_hash_and_email", :unique => true create_table "assets", :force => true do |t| t.column "account_id", :integer t.column "owner_id", :integer t.column "parent_id", :integer t.column "content_type", :string t.column "filename", :string t.column "thumbnail", :string t.column "size", :integer t.column "width", :integer t.column "height", :integer t.column "title", :string t.column "description", :text t.column "created_at", :datetime t.column "updated_at", :datetime t.column "type", :string t.column "email_id", :integer t.column "archive_id", :integer t.column "folder_id", :integer end add_index "assets", ["account_id", "filename"], :name => "index_assets_on_account_id_and_filename" add_index "assets", ["account_id", "title"], :name => "index_assets_on_account_id_and_title" add_index "assets", ["parent_id", "thumbnail"], :name => "index_assets_on_parent_id_and_thumbnail" create_table "assignees", :force => true do |t| t.column "name", :string, :limit => 20, :default => "", :null => false t.column "event_id", :integer t.column "created_at", :datetime t.column "updated_at", :datetime t.column "party_id", :integer t.column "completed_at", :datetime end add_index "assignees", ["event_id"], :name => "task_ref" add_index "assignees", ["party_id"], :name => "staff_member_ref" create_table "authorizations", :force => true do |t| t.column "type", :string t.column "object_type", :string t.column "object_id", :integer t.column "group_id", :integer end add_index "authorizations", ["type", "object_type", "object_id", "group_id"], :name => "by_type_and_object_and_group" add_index "authorizations", ["type", "group_id"], :name => "by_type_and_group" create_table "breadcrumbs", :force => true do |t| t.column "url", :string, :default => "", :null => false t.column "display_name", :string, :default => "", :null => false t.column "updated_at", :datetime, :null => false t.column "target_id", :integer t.column "target_type", :string t.column "owner_id", :integer t.column "icon", :string, :limit => 30 end create_table "cached_feed_items", :force => true do |t| t.column "content", :text t.column "summary", :text t.column "published_at", :datetime t.column "link", :string t.column "title", :string t.column "feed_item_id", :string t.column "cached_feed_id", :integer end create_table "cached_feeds", :force => true do |t| t.column "href", :string t.column "title", :string t.column "link", :string t.column "feed_data", :text t.column "feed_data_type", :string t.column "http_headers", :text t.column "last_retrieved", :datetime end create_table "configurations", :force => true do |t| t.column "type", :string, :limit => 40, :default => "", :null => false t.column "name", :string, :limit => 60, :default => "", :null => false t.column "group_name", :string, :limit => 60 t.column "description", :string, :limit => 240 t.column "product_category_id", :integer t.column "product_id", :integer t.column "int_value", :integer t.column "float_value", :float t.column "str_value", :string, :limit => 240 t.column "party_id", :integer t.column "account_id", :integer end add_index "configurations", ["account_id", "name"], :name => "by_account_id_and_name", :unique => true add_index "configurations", ["account_id", "group_name", "name"], :name => "by_account_id_and_group_name_and_name", :unique => true add_index "configurations", ["product_category_id"], :name => "product_category_id" add_index "configurations", ["product_id"], :name => "product_id" create_table "contact_requests", :force => true do |t| t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "completed_at", :datetime t.column "name", :string, :limit => 80 t.column "email", :string, :limit => 80 t.column "phone", :string, :limit => 30 t.column "time_to_call", :string, :limit => 80 t.column "subject", :string, :limit => 80 t.column "body", :text t.column "account_id", :integer t.column "party_id", :integer end add_index "contact_requests", ["created_at"], :name => "contact_requests_created_at_index" create_table "contact_routes", :force => true do |t| t.column "type", :string, :limit => 60, :default => "", :null => false t.column "position", :integer, :default => 0, :null => false t.column "routable_type", :string t.column "routable_id", :integer t.column "name", :string, :default => "", :null => false t.column "number", :string t.column "extension", :string t.column "email_address", :string t.column "url", :string t.column "line1", :string t.column "line2", :string t.column "line3", :string t.column "city", :string t.column "state", :string t.column "zip", :string t.column "country", :string t.column "account_id", :integer end add_index "contact_routes", ["routable_type", "routable_id", "position"], :name => "by_routable_position" add_index "contact_routes", ["type", "routable_type", "routable_id", "position"], :name => "by_type_routable_position" create_table "denied_permissions", :id => false, :force => true do |t| t.column "permission_id", :integer t.column "party_id", :integer end add_index "denied_permissions", ["permission_id", "party_id"], :name => "by_perm_party", :unique => true create_table "domains", :force => true do |t| t.column "account_id", :integer t.column "name", :string t.column "created_at", :datetime t.column "updated_at", :datetime end create_table "email_accounts", :force => true do |t| t.column "name", :string t.column "type", :string t.column "server", :string t.column "port", :integer, :null => false t.column "username", :string t.column "password", :string t.column "last_queried_at", :string t.column "created_at", :string t.column "updated_at", :string t.column "account_id", :integer, :limit => 8 t.column "party_id", :integer, :limit => 8 end create_table "emails", :force => true do |t| t.column "subject", :string t.column "body", :text t.column "scheduled_at", :datetime t.column "sent_at", :datetime t.column "created_at", :datetime t.column "updated_at", :datetime t.column "released_at", :datetime t.column "bad_recipient_count", :integer t.column "generate_password", :boolean, :default => false, :null => false t.column "unique_id_listing", :string t.column "received_at", :datetime t.column "inline_attachments", :boolean, :default => false, :null => false t.column "about_type", :string t.column "about_id", :integer t.column "account_id", :integer t.column "message_id", :string, :default => "", :null => false t.column "type", :string t.column "return_to_url", :string t.column "remove_tags", :string t.column "opt_out_url", :string end add_index "emails", ["unique_id_listing"], :name => "by_unique_id_listing", :unique => true add_index "emails", ["scheduled_at", "sent_at", "released_at"], :name => "by_scheduled_sent_released" create_table "employees_schedules", :id => false, :force => true do |t| t.column "employee_id", :integer t.column "schedule_id", :integer end add_index "employees_schedules", ["employee_id"], :name => "employee_id" add_index "employees_schedules", ["schedule_id"], :name => "schedule_id" create_table "engine_schema_info", :id => false, :force => true do |t| t.column "engine_name", :string t.column "version", :integer end create_table "estimate_lines", :force => true do |t| t.column "position", :integer, :default => 0 t.column "estimate_id", :integer, :default => 0, :null => false t.column "product_id", :integer t.column "quantity", :integer, :default => 0 t.column "unit_price", :integer, :default => 0 t.column "comment", :string, :limit => 240 t.column "type", :string, :limit => 20 t.column "estimate_section_id", :integer end add_index "estimate_lines", ["product_id"], :name => "product_id" add_index "estimate_lines", ["estimate_id", "position"], :name => "by_estimate_position" create_table "estimate_sections", :force => true do |t| t.column "type", :string t.column "estimate_id", :integer, :null => false t.column "product_id", :integer t.column "description", :text t.column "length", :integer t.column "quantity", :integer t.column "width", :integer t.column "height", :integer t.column "size", :string, :limit => 20 t.column "wrap_style", :string, :limit => 20 end create_table "estimates", :force => true do |t| t.column "company_name", :string, :limit => 60 t.column "last_name", :string, :limit => 40 t.column "first_name", :string, :limit => 40 t.column "email", :string, :limit => 80 t.column "short_description", :string, :limit => 40 t.column "description", :text t.column "roof_walking_allowed", :integer, :default => 0 t.column "roof_slope", :string, :limit => 20 t.column "roof_material", :string, :limit => 20 t.column "number_of_floors", :integer, :default => 0 t.column "number_of_sides", :integer, :default => 0 t.column "lot_style", :string, :limit => 12 t.column "building_style", :string, :limit => 40 t.column "measurement_option", :string, :limit => 8 t.column "no_supplies", :integer, :default => 0 t.column "no_labor", :integer, :default => 0 t.column "contact_method", :string, :limit => 20 t.column "call_time", :string, :limit => 20 t.column "default_light_style_id", :integer t.column "default_light_color", :string, :limit => 20 t.column "base_price", :integer, :default => 0 t.column "fst_active", :integer t.column "fst_name", :string, :limit => 6 t.column "fst_rate", :integer t.column "pst_active", :integer t.column "pst_name", :string, :limit => 6 t.column "pst_rate", :integer t.column "transport_fee", :integer t.column "long_cord_product_id", :integer t.column "med_cord_product_id", :integer t.column "short_cord_product_id", :integer t.column "roof_lines", :integer, :default => 0 t.column "roof_lines_length", :integer, :default => 0 t.column "roof_lines_product_id", :integer t.column "roof_top", :integer, :default => 0 t.column "roof_top_length", :integer, :default => 0 t.column "roof_top_product_id", :integer t.column "eaves", :integer, :default => 0 t.column "eaves_length", :integer, :default => 0 t.column "eaves_product_id", :integer t.column "flat_pct", :integer, :default => 0 t.column "moderate_pct", :integer, :default => 0 t.column "steep_pct", :integer, :default => 0 t.column "number_of_peaks", :integer, :default => 0 t.column "windows", :integer, :default => 0 t.column "windows_qty", :integer, :default => 0 t.column "windows_avg_width", :integer, :default => 0 t.column "windows_avg_height", :integer, :default => 0 t.column "windows_product_id", :integer t.column "garage_doors", :integer, :default => 0 t.column "garage_doors_qty", :integer, :default => 0 t.column "garage_doors_avg_width", :integer, :default => 0 t.column "garage_doors_avg_height", :integer, :default => 0 t.column "garage_doors_product_id", :integer t.column "fences_and_gates", :integer, :default => 0 t.column "fences_and_gates_length", :integer, :default => 0 t.column "fences_and_gates_product_id", :integer t.column "bushes", :integer, :default => 0 t.column "bushes_qty", :integer, :default => 0 t.column "bushes_size", :string, :limit => 20 t.column "bushes_product_id", :integer t.column "trees", :integer, :default => 0 t.column "trees_qty", :integer, :default => 0 t.column "trees_size", :string, :limit => 20 t.column "trees_wrap_style", :string, :limit => 20 t.column "trees_product_id", :integer t.column "paths", :integer, :default => 0 t.column "paths_length", :integer, :default => 0 t.column "paths_product_id", :integer t.column "garlands", :integer, :default => 0 t.column "garlands_length", :integer, :default => 0 t.column "garlands_product_id", :integer t.column "wreaths", :integer, :default => 0 t.column "wreaths_qty", :integer, :default => 0 t.column "wreaths_product_id", :integer t.column "inflatables", :integer, :default => 0 t.column "inflatables_qty", :integer, :default => 0 t.column "inflatables_product_id", :integer t.column "ropelight_sculptures", :integer, :default => 0 t.column "ropelight_sculptures_qty", :integer, :default => 0 t.column "ropelight_sculptures_product_id", :integer, :default => 0 t.column "animate", :integer, :default => 0 t.column "animate_product_id", :integer t.column "created_at", :datetime t.column "updated_at", :datetime t.column "stage", :string, :limit => 20 t.column "billing_customer_id", :integer t.column "phone_location", :string, :limit => 20 t.column "phone_number", :string, :limit => 20 t.column "picture_id", :integer t.column "equipment_fee", :integer, :default => 0, :null => false t.column "apply_federal_tax_on_products", :boolean, :default => false, :null => false t.column "apply_federal_tax_on_labor", :boolean, :default => false, :null => false t.column "apply_provincial_tax_on_products", :boolean, :default => false, :null => false t.column "apply_provincial_tax_on_labor", :boolean, :default => false, :null => false t.column "shipping_fee", :integer t.column "shipping_method", :string t.column "notes", :text t.column "static", :boolean, :default => false, :null => false t.column "billing_phone_id", :integer t.column "billing_address_id", :integer t.column "onsite_customer_id", :integer t.column "onsite_phone_id", :integer t.column "onsite_address_id", :integer t.column "uuid", :string, :limit => 40 t.column "last_updated_by_id", :integer t.column "account_id", :integer end add_index "estimates", ["uuid"], :name => "by_uuid", :unique => true add_index "estimates", ["billing_customer_id"], :name => "estimates_customer_id_index" add_index "estimates", ["updated_at"], :name => "by_updated_at" create_table "events", :force => true do |t| t.column "type", :string, :limit => 40 t.column "owner_id", :integer, :default => 0, :null => false t.column "scheduled_date", :date t.column "scheduled_time", :time t.column "duration_in_minutes", :integer t.column "subject", :string, :default => "", :null => false t.column "body", :text t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "reference_id", :integer t.column "occured_at", :datetime t.column "account_id", :integer end add_index "events", ["scheduled_date", "scheduled_time"], :name => "by_date_time" add_index "events", ["owner_id", "scheduled_date", "scheduled_time"], :name => "by_owner_date_time" create_table "feeds", :force => true do |t| t.column "url", :string t.column "account_id", :integer t.column "label", :string t.column "description", :text t.column "created_at", :datetime t.column "updated_at", :datetime end create_table "feeds_parties", :id => false, :force => true do |t| t.column "party_id", :integer t.column "feed_id", :integer end create_table "folders", :force => true do |t| t.column "parent_id", :integer t.column "lft", :integer t.column "rgt", :integer t.column "updated_at", :datetime t.column "name", :string, :default => "", :null => false t.column "account_id", :integer t.column "private", :boolean, :default => false t.column "owner_id", :integer t.column "description", :text t.column "inherit", :boolean, :default => false t.column "pass_on_attr", :boolean, :default => false end create_table "forum_categories", :force => true do |t| t.column "name", :string, :limit => 100, :default => "", :null => false t.column "description", :string t.column "account_id", :integer, :null => false end create_table "forum_posts", :force => true do |t| t.column "user_id", :integer t.column "topic_id", :integer t.column "body", :text t.column "created_at", :datetime t.column "updated_at", :datetime t.column "forum_id", :integer t.column "account_id", :integer t.column "forum_category_id", :integer, :limit => 8 t.column "rendered_body", :text end add_index "forum_posts", ["user_id"], :name => "index_posts_on_user_id" add_index "forum_posts", ["topic_id"], :name => "index_posts_on_topic_id" create_table "forum_topics", :force => true do |t| t.column "forum_id", :integer t.column "user_id", :integer t.column "title", :string t.column "created_at", :datetime t.column "updated_at", :datetime t.column "hits", :integer, :default => 0 t.column "sticky", :integer, :default => 0 t.column "posts_count", :integer, :default => 0 t.column "replied_at", :datetime t.column "locked", :boolean, :default => false t.column "replied_by", :integer t.column "last_post_id", :integer t.column "account_id", :integer t.column "forum_category_id", :integer, :limit => 8 end add_index "forum_topics", ["forum_id"], :name => "index_topics_on_forum_id" create_table "forums", :force => true do |t| t.column "name", :string t.column "description", :string t.column "topics_count", :integer, :default => 0 t.column "posts_count", :integer, :default => 0 t.column "position", :integer t.column "account_id", :integer t.column "forum_category_id", :integer, :limit => 8 end create_table "futures", :force => true do |t| t.column "type", :string t.column "account_id", :integer t.column "owner_id", :integer t.column "status", :string, :default => "unstarted" t.column "autoclean", :boolean, :default => false t.column "args", :text t.column "results", :text t.column "result_url", :string t.column "started_at", :datetime t.column "ended_at", :datetime t.column "created_at", :datetime t.column "updated_at", :datetime t.column "interval", :integer t.column "scheduled_at", :datetime t.column "system", :boolean, :default => false t.column "progress", :integer, :default => 0, :null => false t.column "priority", :integer, :default => 100 end add_index "futures", ["account_id", "status", "scheduled_at", "created_at"], :name => "by_account_status_scheduled_created" create_table "geopositions", :force => true do |t| t.column "zip", :string t.column "zip_type", :string t.column "city_name", :string t.column "city_type", :string t.column "state_name", :string t.column "state_abbr", :string t.column "area_code", :string t.column "latitude", :float t.column "longitude", :float end create_table "imports", :force => true do |t| t.column "account_id", :integer, :limit => 8, :null => false t.column "party_id", :integer, :null => false t.column "csv", :text t.column "import_errors", :text t.column "imported_lines", :text t.column "created_at", :datetime t.column "updated_at", :datetime t.column "filename", :string t.column "force", :boolean t.column "mappings", :text end create_table "interests", :force => true do |t| t.column "party_id", :integer t.column "listing_id", :integer t.column "note", :text t.column "created_at", :datetime t.column "updated_at", :datetime end create_table "invoice_lines", :force => true do |t| t.column "invoice_id", :integer, :null => false t.column "position", :integer, :null => false t.column "type", :string, :default => "", :null => false t.column "product_id", :integer t.column "quantity", :integer, :null => false t.column "unit_price", :integer, :null => false t.column "comment", :string end add_index "invoice_lines", ["invoice_id", "position"], :name => "invoice_lines_invoice_id_index" create_table "invoices", :force => true do |t| t.column "customer_id", :integer, :null => false t.column "no", :integer, :null => false t.column "date", :date, :null => false t.column "notes", :text t.column "description", :text t.column "deposit_amount", :integer t.column "transport_fee", :integer t.column "equipment_fee", :integer t.column "shipping_fee", :integer t.column "shipping_method", :string t.column "apply_federal_tax_on_products", :boolean, :default => false, :null => false t.column "apply_provincial_tax_on_products", :boolean, :default => false, :null => false t.column "apply_federal_tax_on_labor", :boolean, :default => false, :null => false t.column "apply_provincial_tax_on_labor", :boolean, :default => false, :null => false t.column "pst_active", :boolean, :default => false, :null => false t.column "pst_name", :string, :default => "", :null => false t.column "pst_rate", :integer, :null => false t.column "fst_active", :boolean, :default => false, :null => false t.column "fst_name", :string, :default => "", :null => false t.column "fst_rate", :integer, :null => false t.column "picture_id", :integer t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "phone_number", :string, :limit => 32, :default => "", :null => false t.column "paid_in_full", :boolean, :default => false, :null => false t.column "voided_at", :datetime t.column "voided_by_id", :integer t.column "account_id", :integer t.column "status", :string, :limit => 40 end add_index "invoices", ["no"], :name => "invoices_no_index" add_index "invoices", ["customer_id"], :name => "invoices_customer_id_index" add_index "invoices", ["date"], :name => "invoices_date_index" create_table "items", :force => true do |t| t.column "parent_id", :integer t.column "creator_id", :integer t.column "title", :string t.column "slug", :string t.column "position", :integer t.column "body", :text t.column "behavior", :string, :limit => 40, :default => "plain_text" t.column "uuid", :string, :limit => 36 t.column "published_at", :datetime t.column "status", :string, :limit => 20, :default => "draft" t.column "created_at", :datetime t.column "updated_at", :datetime t.column "account_id", :integer t.column "layout_id", :integer t.column "type", :string t.column "fullslug", :string end add_index "items", ["uuid"], :name => "by_guid", :unique => true add_index "items", ["account_id", "parent_id", "position"], :name => "by_parent_position" add_index "items", ["account_id", "status", "fullslug"], :name => "by_account_status_fullslug" create_table "job_slots_teams", :id => false, :force => true do |t| t.column "job_slot_id", :integer, :default => 0, :null => false t.column "team_id", :integer, :default => 0, :null => false end add_index "job_slots_teams", ["team_id"], :name => "team_id" create_table "layouts", :force => true do |t| t.column "title", :string, :default => "", :null => false t.column "body", :text t.column "content_type", :string, :default => "text/html", :null => false t.column "encoding", :string, :default => "UTF-8", :null => false t.column "author_id", :integer, :null => false t.column "updated_at", :datetime t.column "account_id", :integer end create_table "link_categories", :force => true do |t| t.column "name", :string, :limit => 50, :default => "", :null => false t.column "description", :string, :limit => 200, :default => "" t.column "account_id", :integer t.column "parent_id", :integer end create_table "link_categories_links", :id => false, :force => true do |t| t.column "link_category_id", :integer t.column "link_id", :integer end create_table "links", :force => true do |t| t.column "picture_id", :integer t.column "title", :string, :limit => 240, :default => "", :null => false t.column "description", :text t.column "address", :string, :limit => 240, :default => "", :null => false t.column "active_on", :date t.column "inactive_on", :date t.column "updated_at", :datetime t.column "account_id", :integer t.column "reciprocal", :boolean, :default => false t.column "reciprocal_address", :string t.column "approved", :boolean, :default => false end create_table "listings", :force => true do |t| t.column "address_id", :integer, :default => 0, :null => false t.column "realtor_id", :integer t.column "mls_no", :string, :limit => 12 t.column "fireplace", :boolean, :default => false, :null => false t.column "central_ac", :boolean, :default => false, :null => false t.column "pool", :boolean, :default => false, :null => false t.column "waterfront", :boolean, :default => false, :null => false t.column "workshop", :boolean, :default => false, :null => false t.column "house_size", :float, :default => 0.0, :null => false t.column "house_size_unit", :string, :default => "", :null => false t.column "lot_size", :float, :default => 0.0, :null => false t.column "lot_size_unit", :string, :default => "", :null => false t.column "features", :text t.column "description", :text t.column "price", :integer t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "uuid", :string t.column "public", :boolean, :default => true, :null => false t.column "account_id", :integer t.column "external_id", :string t.column "raw_property_data", :text t.column "extras", :text end add_index "listings", ["account_id", "external_id"], :name => "by_account_ext_id", :unique => true create_table "mappers", :force => true do |t| t.column "account_id", :integer, :limit => 8 t.column "mappings", :text t.column "name", :string, :limit => 63 t.column "description", :string t.column "created_at", :datetime t.column "updated_at", :datetime end create_table "memberships", :id => false, :force => true do |t| t.column "party_id", :integer t.column "group_id", :integer end create_table "parties", :force => true do |t| t.column "company_name", :string, :limit => 60 t.column "last_name", :string, :limit => 40 t.column "middle_name", :string, :limit => 40 t.column "first_name", :string, :limit => 40 t.column "honorific", :string, :limit => 20 t.column "notes", :text t.column "referal", :text t.column "created_at", :datetime t.column "updated_at", :datetime t.column "archived_at", :datetime t.column "login", :string, :limit => 32 t.column "password_hash", :string, :limit => 40 t.column "website_url", :string, :limit => 240 t.column "dropship_email", :string, :limit => 120 t.column "send_email_on_order", :boolean, :default => false, :null => false t.column "order_type", :string, :limit => 30 t.column "climbing_experience", :string, :limit => 20 t.column "rope_work_safety_gear_experience", :string, :limit => 20 t.column "outdoor_gear", :boolean, :default => false, :null => false t.column "vehicle_type", :string, :limit => 20 t.column "vehicle_roof_rack", :boolean, :default => false, :null => false t.column "team_manager", :boolean, :default => false, :null => false t.column "staff_agreement_date", :datetime t.column "staff_agreement_version", :integer t.column "on_tour", :boolean, :default => false, :null => false t.column "allow_mail_in", :boolean, :default => false, :null => false t.column "uuid", :string t.column "display_name", :string, :default => "", :null => false t.column "posts_count", :integer, :default => 0, :null => false t.column "token", :string t.column "position", :string t.column "account_id", :integer t.column "superuser", :boolean, :default => false, :null => false t.column "signature", :text t.column "password_salt", :string, :limit => 40 t.column "token_expires_at", :datetime t.column "last_logged_in_at", :datetime t.column "created_by_id", :integer t.column "updated_by_id", :integer t.column "referred_by_id", :integer t.column "confirmation_token", :string t.column "confirmation_token_expires_at", :datetime t.column "avatar_id", :integer t.column "forum_alias", :string t.column "timezone", :string, :default => "America/Vancouver" t.column "birthdate", :date t.column "biography", :text t.column "date_format", :string, :default => "%Y-%m-%d" t.column "time_format", :string, :default => "%H:%M" t.column "google_login", :string end add_index "parties", ["login", "password_hash"], :name => "parties_login_index", :unique => true add_index "parties", ["token"], :name => "index_parties_on_token", :unique => true add_index "parties", ["company_name", "last_name", "first_name", "updated_at"], :name => "customers_company_name_index" create_table "party_pictures", :force => true do |t| t.column "description", :text t.column "style", :string, :limit => 20, :default => "", :null => false t.column "party_id", :integer t.column "created_at", :datetime t.column "updated_at", :datetime t.column "destroyed_at", :datetime t.column "picture_id", :integer t.column "public", :boolean, :default => false, :null => false end add_index "party_pictures", ["party_id"], :name => "customer_ref" add_index "party_pictures", ["public"], :name => "party_pictures_public_index" create_table "payment_plans", :force => true do |t| t.column "name", :string, :limit => 100 t.column "description", :string t.column "duration_in_seconds", :integer, :limit => 8 t.column "amount_in_cents", :integer, :limit => 8 t.column "disabled_at", :datetime t.column "created_at", :datetime t.column "updated_at", :datetime end create_table "payments", :force => true do |t| t.column "reason", :string, :limit => 60 t.column "amount", :integer t.column "status", :string, :limit => 40 t.column "external_txn_id", :string, :limit => 60 t.column "ever_failed", :boolean, :default => false, :null => false t.column "created_at", :datetime t.column "updated_at", :datetime t.column "type", :string, :limit => 40 t.column "payable_id", :integer t.column "payable_type", :string, :default => "", :null => false t.column "account_id", :integer end add_index "payments", ["created_at"], :name => "by_invoice_timeline" add_index "payments", ["created_at"], :name => "by_timeline" create_table "permission_sets", :force => true do |t| t.column "name", :string t.column "parent_id", :integer t.column "created_at", :datetime t.column "created_by_id", :integer t.column "updated_at", :datetime t.column "updated_by_id", :integer t.column "account_id", :integer, :null => false t.column "type", :string end create_table "permissions", :force => true do |t| t.column "name", :string, :limit => 80, :default => "" end add_index "permissions", ["name"], :name => "permissions_name_index", :unique => true create_table "pictures", :force => true do |t| t.column "mime_type", :string, :limit => 32, :default => "", :null => false t.column "size", :integer, :default => 0, :null => false t.column "filename", :string, :limit => 96, :default => "", :null => false t.column "geometry", :string, :limit => 12, :default => "", :null => false t.column "public", :boolean, :default => false, :null => false t.column "data", :binary t.column "title", :string, :limit => 120 t.column "description", :text t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "account_id", :integer end create_table "product_categories", :force => true do |t| t.column "name", :string, :limit => 60 t.column "parent_id", :integer t.column "picture_id", :integer t.column "account_id", :integer end add_index "product_categories", ["parent_id", "name"], :name => "parent_id", :unique => true create_table "product_categories_products", :id => false, :force => true do |t| t.column "product_id", :integer, :default => 0, :null => false t.column "product_category_id", :integer, :default => 0, :null => false end add_index "product_categories_products", ["product_id", "product_category_id"], :name => "product_categories_products_product_id_index", :unique => true create_table "products", :force => true do |t| t.column "name", :string, :limit => 80, :default => "" t.column "unit_price", :integer, :default => 0, :null => false t.column "base_length", :integer, :default => 0, :null => false t.column "product_no", :string, :limit => 60 t.column "description", :text t.column "supplier_id", :integer t.column "destroyed_at", :datetime t.column "sku", :string, :limit => 40 t.column "barcode", :string, :limit => 40 t.column "availability", :string, :limit => 40 t.column "available_on", :date t.column "last_ordered_on", :date t.column "instock", :integer, :default => 0, :null => false t.column "sale_price", :integer, :default => 0, :null => false t.column "sale_starts_on", :date t.column "sale_ends_on", :date t.column "wholesale_price", :integer, :default => 0, :null => false t.column "destroyed", :boolean, :default => false, :null => false t.column "picture_id", :integer t.column "account_id", :integer end create_table "recipients", :force => true do |t| t.column "email_id", :integer t.column "party_id", :integer t.column "sent_at", :datetime t.column "read_at", :datetime t.column "address", :string t.column "extras", :text t.column "generated_subject", :string t.column "generated_body", :text t.column "account_id", :integer t.column "name", :string, :limit => 512 t.column "type", :string t.column "recipient_builder_id", :integer t.column "recipient_builder_type", :string t.column "tag_syntax", :string t.column "uuid", :string, :limit => 40 end add_index "recipients", ["party_id", "type", "email_id"], :name => "by_party_type_email" create_table "referrals", :force => true do |t| t.column "account_id", :integer t.column "email_id", :integer t.column "parent_id", :integer t.column "party_id", :integer t.column "uuid", :string t.column "created_at", :datetime t.column "referral_url", :string t.column "reference_id", :integer t.column "reference_type", :string end create_table "rets_metadatas", :force => true do |t| t.column "name", :string t.column "version", :string, :limit => 20 t.column "date", :date t.column "values", :text t.column "created_at", :datetime t.column "updated_at", :datetime end add_index "rets_metadatas", ["name", "date", "version"], :name => "index_rets_metadatas_on_name_and_date_and_version", :unique => true create_table "roles", :force => true do |t| t.column "roleable_id", :integer t.column "permission_id", :integer, :default => 0, :null => false t.column "roleable_type", :string end add_index "roles", ["roleable_type", "roleable_id", "permission_id"], :name => "by_role_perm", :unique => true add_index "roles", ["permission_id", "roleable_type", "roleable_id"], :name => "by_perm_role", :unique => true create_table "search_lines", :force => true do |t| t.column "subject_name", :string, :limit => 40 t.column "subject_option", :string, :limit => 40 t.column "subject_value", :string, :limit => 40 t.column "subject_exclude", :boolean t.column "priority", :integer, :limit => 8 t.column "search_id", :integer, :limit => 8 end create_table "searches", :force => true do |t| t.column "name", :string, :limit => 40 t.column "description", :string, :limit => 200 t.column "party_id", :integer, :limit => 8 t.column "account_id", :integer end create_table "sessions", :force => true do |t| t.column "sessid", :string, :limit => 32, :default => "", :null => false t.column "data", :text t.column "updated_at", :datetime end add_index "sessions", ["sessid"], :name => "sessid", :unique => true create_table "sort_lines", :force => true do |t| t.column "order_name", :string, :limit => 40 t.column "order_mode", :string, :limit => 5 t.column "priority", :integer, :limit => 8 t.column "search_id", :integer, :limit => 8 end create_table "taggings", :force => true do |t| t.column "tag_id", :integer, :null => false t.column "taggable_type", :string, :default => "", :null => false t.column "taggable_id", :integer, :null => false end add_index "taggings", ["tag_id", "taggable_type", "taggable_id"], :name => "taggings_tag_id_index", :unique => true add_index "taggings", ["taggable_type", "taggable_id", "tag_id"], :name => "taggings_taggable_type_index", :unique => true create_table "tags", :force => true do |t| t.column "name", :string, :limit => 80, :default => "", :null => false t.column "account_id", :integer t.column "system", :boolean, :default => false end add_index "tags", ["account_id", "name"], :name => "by_account_name", :unique => true create_table "teams", :force => true do |t| t.column "name", :string, :limit => 40, :default => "", :null => false t.column "account_id", :integer end create_table "templates", :force => true do |t| t.column "subject", :string t.column "body", :text t.column "created_at", :datetime t.column "updated_at", :datetime t.column "party_id", :integer t.column "account_id", :integer t.column "label", :string t.column "description", :string end create_table "testimonials", :force => true do |t| t.column "party_id", :integer, :null => false t.column "testified_on", :date, :null => false t.column "body", :text t.column "created_at", :datetime, :null => false t.column "updated_at", :datetime, :null => false t.column "approved_at", :datetime t.column "rejected_at", :datetime t.column "account_id", :integer end create_table "views", :force => true do |t| t.column "listing_id", :integer t.column "position", :integer t.column "name", :string t.column "description", :text t.column "asset_id", :integer end end