diff --git a/config/routes.rb b/config/routes.rb index ef81e9d..06345ef 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -91,6 +91,7 @@ CMSnb::Application.routes.draw do namespace :admin do resources :contacts + resources :contact_actions resources :student_groups resources :note_files resources :notes diff --git a/db/migrate/20160928204535_add_color_to_admins.rb b/db/migrate/20160928204535_add_color_to_admins.rb new file mode 100644 index 0000000..5204a17 --- /dev/null +++ b/db/migrate/20160928204535_add_color_to_admins.rb @@ -0,0 +1,6 @@ +class AddColorToAdmins < ActiveRecord::Migration + def change + add_column :admins, :color, :string + add_column :admins, :contact_role, :boolean + end +end diff --git a/db/migrate/20160928204801_add_admin_to_contacts.rb b/db/migrate/20160928204801_add_admin_to_contacts.rb new file mode 100644 index 0000000..697e4ce --- /dev/null +++ b/db/migrate/20160928204801_add_admin_to_contacts.rb @@ -0,0 +1,7 @@ +class AddAdminToContacts < ActiveRecord::Migration + def change + add_column :contacts, :admin_id, :integer + add_column :contacts, :archived, :boolean, :default => false + add_column :contacts, :provenance_id, :integer, :default => 1 + end +end diff --git a/db/migrate/20160928211606_create_contact_actions.rb b/db/migrate/20160928211606_create_contact_actions.rb new file mode 100644 index 0000000..6442393 --- /dev/null +++ b/db/migrate/20160928211606_create_contact_actions.rb @@ -0,0 +1,14 @@ +class CreateContactActions < ActiveRecord::Migration + def change + create_table :contact_actions do |t| + t.integer :admin_id + t.datetime :action_at + t.references :contact, index: true + t.string :action_title + t.text :action_message + t.references :contact_action_pattern + + t.timestamps + end + end +end diff --git a/db/migrate/20161007085559_create_contact_action_patterns.rb b/db/migrate/20161007085559_create_contact_action_patterns.rb new file mode 100644 index 0000000..62fce3b --- /dev/null +++ b/db/migrate/20161007085559_create_contact_action_patterns.rb @@ -0,0 +1,21 @@ +class CreateContactActionPatterns < ActiveRecord::Migration + def change + create_table :contact_action_patterns do |t| + t.string :title + t.text :description + + + + + t.timestamps + end + + ContactActionPattern.create(:title => "Appel") + ContactActionPattern.create(:title => "1er Contact") + ContactActionPattern.create(:title => "RDV") + ContactActionPattern.create(:title => "Devis") + + ContactActionPattern.create(:title => "Autre") + + end +end diff --git a/db/schema.rb b/db/schema.rb index 1db536e..998899b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151101172457) do +ActiveRecord::Schema.define(version: 20161007085559) do create_table "admins", force: true do |t| t.string "name" @@ -31,6 +31,8 @@ ActiveRecord::Schema.define(version: 20151101172457) do t.string "remember_token" t.datetime "created_at" t.datetime "updated_at" + t.string "color" + t.boolean "contact_role" end create_table "albums", force: true do |t| @@ -145,6 +147,26 @@ ActiveRecord::Schema.define(version: 20151101172457) do add_index "comments", ["commentable_id"], name: "index_comments_on_commentable_id", using: :btree add_index "comments", ["commentable_type"], name: "index_comments_on_commentable_type", length: {"commentable_type"=>191}, using: :btree + create_table "contact_action_patterns", force: true do |t| + t.string "title" + t.text "description" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "contact_actions", force: true do |t| + t.integer "admin_id" + t.datetime "action_at" + t.integer "contact_id" + t.string "action_title" + t.text "action_message" + t.integer "contact_action_pattern_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "contact_actions", ["contact_id"], name: "index_contact_actions_on_contact_id", using: :btree + create_table "contacts", force: true do |t| t.string "name" t.string "email" @@ -162,6 +184,9 @@ ActiveRecord::Schema.define(version: 20151101172457) do t.text "notes" t.string "statut" t.boolean "readed" + t.integer "admin_id" + t.boolean "archived", default: false + t.integer "provenance_id", default: 1 end create_table "content_types", force: true do |t|