fat_free_crm 0.18.1 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/brakeman-analysis.yml +46 -0
- data/.github/workflows/rubocop-analysis.yml +40 -0
- data/.github/workflows/ruby.yml +52 -0
- data/.rubocop_todo.yml +80 -173
- data/.travis.yml +17 -20
- data/CHANGELOG.md +63 -3
- data/CONTRIBUTORS.md +1 -0
- data/Dockerfile +45 -14
- data/Gemfile +21 -11
- data/Gemfile.lock +315 -263
- data/Procfile +1 -1
- data/README.md +6 -5
- data/Rakefile +1 -1
- data/SECURITY.md +11 -0
- data/app/assets/javascripts/application.js.erb +3 -0
- data/app/assets/stylesheets/application.css.erb +1 -0
- data/app/assets/stylesheets/base.scss +9 -2
- data/app/assets/stylesheets/bootstrap-custom.scss +206 -0
- data/app/assets/stylesheets/common.scss +88 -68
- data/app/assets/stylesheets/header.scss +0 -8
- data/app/controllers/admin/application_controller.rb +1 -1
- data/app/controllers/admin/field_groups_controller.rb +2 -4
- data/app/controllers/admin/fields_controller.rb +1 -1
- data/app/controllers/admin/groups_controller.rb +1 -1
- data/app/controllers/admin/tags_controller.rb +3 -5
- data/app/controllers/admin/users_controller.rb +7 -9
- data/app/controllers/application_controller.rb +21 -45
- data/app/controllers/comments_controller.rb +3 -6
- data/{config/initializers/authlogic.rb → app/controllers/confirmations_controller.rb} +4 -2
- data/app/controllers/emails_controller.rb +0 -2
- data/app/controllers/entities/accounts_controller.rb +2 -4
- data/app/controllers/entities/campaigns_controller.rb +2 -4
- data/app/controllers/entities/contacts_controller.rb +4 -24
- data/app/controllers/entities/leads_controller.rb +7 -10
- data/app/controllers/entities/opportunities_controller.rb +4 -14
- data/app/controllers/entities_controller.rb +21 -7
- data/app/controllers/home_controller.rb +5 -5
- data/app/controllers/lists_controller.rb +1 -1
- data/app/controllers/passwords_controller.rb +3 -59
- data/{spec/features/support/maintain_sessions.rb → app/controllers/registrations_controller.rb} +12 -5
- data/{lib/development_tasks/gem.rake → app/controllers/sessions_controller.rb} +6 -6
- data/app/controllers/tasks_controller.rb +11 -20
- data/app/controllers/users_controller.rb +11 -30
- data/app/helpers/accounts_helper.rb +12 -0
- data/app/helpers/admin/users_helper.rb +1 -1
- data/app/helpers/application_helper.rb +30 -37
- data/app/helpers/campaigns_helper.rb +1 -1
- data/app/helpers/contacts_helper.rb +1 -3
- data/app/helpers/opportunities_helper.rb +4 -12
- data/app/helpers/tasks_helper.rb +3 -3
- data/app/helpers/users_helper.rb +1 -3
- data/{config/initializers/paper_trail.rb → app/mailers/devise_mailer.rb} +5 -1
- data/app/mailers/user_mailer.rb +0 -9
- data/app/models/entities/account.rb +11 -11
- data/app/models/entities/account_contact.rb +1 -1
- data/app/models/entities/account_opportunity.rb +1 -1
- data/app/models/entities/campaign.rb +5 -7
- data/app/models/entities/contact.rb +25 -13
- data/app/models/entities/lead.rb +8 -8
- data/app/models/entities/opportunity.rb +8 -10
- data/app/models/fields/custom_field.rb +1 -0
- data/app/models/fields/custom_field_date_pair.rb +2 -0
- data/app/models/fields/custom_field_pair.rb +2 -2
- data/app/models/fields/field.rb +1 -3
- data/app/models/list.rb +1 -1
- data/app/models/observers/entity_observer.rb +3 -7
- data/app/models/observers/lead_observer.rb +2 -4
- data/app/models/observers/opportunity_observer.rb +3 -5
- data/app/models/observers/task_observer.rb +1 -1
- data/app/models/polymorphic/address.rb +1 -1
- data/app/models/polymorphic/comment.rb +1 -1
- data/app/models/polymorphic/email.rb +3 -3
- data/app/models/polymorphic/task.rb +14 -10
- data/app/models/polymorphic/version.rb +3 -2
- data/app/models/setting.rb +5 -1
- data/app/models/users/permission.rb +3 -3
- data/app/models/users/preference.rb +4 -3
- data/app/models/users/user.rb +67 -42
- data/app/views/accounts/_edit.html.haml +2 -2
- data/app/views/accounts/_new.html.haml +2 -2
- data/app/views/accounts/_sidebar_index.html.haml +2 -2
- data/app/views/accounts/_sidebar_show.html.haml +19 -19
- data/app/views/accounts/_top_section.html.haml +1 -1
- data/app/views/accounts/create.js.haml +1 -2
- data/app/views/accounts/destroy.js.haml +1 -1
- data/app/views/accounts/edit.js.haml +1 -1
- data/app/views/accounts/show.html.haml +1 -0
- data/app/views/accounts/update.js.haml +4 -5
- data/app/views/admin/field_groups/create.js.haml +0 -1
- data/app/views/admin/field_groups/destroy.js.haml +0 -1
- data/app/views/admin/field_groups/update.js.haml +0 -1
- data/app/views/admin/fields/create.js.haml +0 -1
- data/app/views/admin/fields/destroy.js.haml +0 -1
- data/app/views/admin/fields/update.js.haml +0 -1
- data/app/views/admin/groups/create.js.haml +0 -1
- data/app/views/admin/groups/destroy.js.haml +0 -1
- data/app/views/admin/groups/update.js.haml +0 -1
- data/app/views/admin/tags/create.js.haml +0 -1
- data/app/views/admin/tags/destroy.js.haml +0 -1
- data/app/views/admin/tags/update.js.haml +0 -1
- data/app/views/admin/users/_user.html.haml +4 -4
- data/app/views/admin/users/create.js.haml +0 -1
- data/app/views/admin/users/destroy.js.haml +0 -1
- data/app/views/admin/users/update.js.haml +0 -1
- data/app/views/campaigns/_edit.html.haml +1 -1
- data/app/views/campaigns/_new.html.haml +1 -1
- data/app/views/campaigns/_sidebar_index.html.haml +2 -2
- data/app/views/campaigns/_sidebar_show.html.haml +68 -67
- data/app/views/campaigns/create.js.haml +1 -2
- data/app/views/campaigns/destroy.js.haml +1 -1
- data/app/views/campaigns/show.html.haml +1 -0
- data/app/views/campaigns/update.js.haml +3 -4
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +1 -1
- data/app/views/comments/update.js.haml +0 -1
- data/app/views/contacts/_edit.html.haml +1 -1
- data/app/views/contacts/_index_brief.html.haml +1 -1
- data/app/views/contacts/_index_full.html.haml +1 -1
- data/app/views/contacts/_index_long.html.haml +1 -1
- data/app/views/contacts/_new.html.haml +1 -1
- data/app/views/contacts/_sidebar_show.html.haml +18 -18
- data/app/views/contacts/create.js.haml +0 -1
- data/app/views/contacts/destroy.js.haml +1 -1
- data/app/views/contacts/show.html.haml +1 -0
- data/app/views/contacts/update.js.haml +2 -3
- data/app/views/devise/confirmations/new.html.haml +9 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/devise/mailer/password_change.html.haml +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/devise/passwords/edit.html.haml +18 -0
- data/app/views/devise/passwords/new.html.haml +10 -0
- data/app/views/devise/registrations/new.html.haml +21 -0
- data/app/views/devise/sessions/new.html.haml +32 -0
- data/app/views/entities/_title_bar.html.haml +1 -1
- data/app/views/entities/attach.js.haml +2 -2
- data/app/views/entities/discard.js.haml +2 -2
- data/app/views/home/_opportunity.html.haml +1 -1
- data/app/views/home/_task.html.haml +1 -1
- data/app/views/home/index.xls.builder +51 -0
- data/app/views/layouts/_about.html.haml +5 -5
- data/app/views/layouts/_header.html.haml +3 -3
- data/app/views/layouts/_sidebar.html.haml +2 -2
- data/app/views/layouts/_tabbed.html.haml +14 -11
- data/app/views/layouts/admin/_header.html.haml +1 -1
- data/app/views/layouts/application.html.haml +2 -2
- data/app/views/leads/_edit.html.haml +2 -2
- data/app/views/leads/_new.html.haml +2 -2
- data/app/views/leads/_sidebar_index.html.haml +2 -2
- data/app/views/leads/_sidebar_show.html.haml +30 -30
- data/app/views/leads/create.js.haml +2 -3
- data/app/views/leads/destroy.js.haml +2 -2
- data/app/views/leads/promote.js.haml +3 -4
- data/app/views/leads/reject.js.haml +3 -3
- data/app/views/leads/show.html.haml +1 -1
- data/app/views/leads/update.js.haml +4 -5
- data/app/views/lists/create.js.haml +0 -1
- data/app/views/opportunities/_edit.html.haml +1 -1
- data/app/views/opportunities/_index_brief.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -1
- data/app/views/opportunities/_new.html.haml +1 -1
- data/app/views/opportunities/_sidebar_index.html.haml +2 -2
- data/app/views/opportunities/_sidebar_show.html.haml +47 -46
- data/app/views/opportunities/create.js.haml +3 -4
- data/app/views/opportunities/destroy.js.haml +3 -3
- data/app/views/opportunities/show.html.haml +1 -0
- data/app/views/opportunities/update.js.haml +5 -6
- data/app/views/shared/_address.html.haml +5 -5
- data/app/views/shared/_empty.html.haml +1 -1
- data/app/views/shared/_inline_styles.html.haml +0 -26
- data/app/views/shared/_paginate_with_per_page.html.haml +1 -0
- data/app/views/tasks/_assigned.html.haml +1 -1
- data/app/views/tasks/_completed.html.haml +1 -1
- data/app/views/tasks/_edit.html.haml +1 -1
- data/app/views/tasks/_new.html.haml +1 -1
- data/app/views/tasks/_pending.html.haml +1 -1
- data/app/views/tasks/_related.html.haml +1 -1
- data/app/views/tasks/_selector.html.haml +7 -8
- data/app/views/tasks/_sidebar_index.html.haml +2 -2
- data/app/views/tasks/_title.html.haml +1 -1
- data/app/views/tasks/complete.js.haml +1 -1
- data/app/views/tasks/create.js.haml +1 -2
- data/app/views/tasks/destroy.js.haml +1 -1
- data/app/views/tasks/uncomplete.js.haml +1 -2
- data/app/views/tasks/update.js.haml +0 -1
- data/app/views/users/_avatar.html.haml +1 -1
- data/app/views/users/change_password.js.haml +0 -1
- data/app/views/users/update.js.haml +0 -1
- data/app/views/users/upload_avatar.js.haml +0 -1
- data/app/views/versions/_version_item.html.haml +1 -1
- data/bin/bundle +1 -1
- data/bin/rails +1 -1
- data/bin/setup +38 -0
- data/bin/update +33 -0
- data/bin/yarn +13 -0
- data/config/application.rb +8 -6
- data/config/boot.rb +1 -1
- data/config/brakeman.ignore +2 -2
- data/config/database.postgres.docker.yml +5 -5
- data/config/environment.rb +2 -2
- data/config/environments/development.rb +1 -0
- data/config/environments/test.rb +7 -0
- data/config/initializers/action_mailer.rb +1 -3
- data/config/initializers/application_controller_renderer.rb +9 -0
- data/config/initializers/assets.rb +6 -11
- data/config/initializers/backtrace_silencers.rb +0 -6
- data/config/initializers/content_security_policy.rb +31 -0
- data/config/initializers/cookies_serializer.rb +3 -6
- data/config/initializers/devise.rb +289 -0
- data/config/initializers/filter_parameter_logging.rb +0 -5
- data/config/initializers/gravatar.rb +0 -1
- data/config/initializers/inflections.rb +0 -6
- data/config/initializers/mime_types.rb +1 -9
- data/config/initializers/new_framework_defaults_6_0.rb +46 -0
- data/config/initializers/relative_url_root.rb +1 -3
- data/config/initializers/session_store.rb +1 -3
- data/config/initializers/simple_form.rb +135 -55
- data/config/initializers/simple_form_bootstrap.rb +433 -0
- data/config/initializers/wrap_parameters.rb +4 -9
- data/config/locales/fat_free_crm.cs.yml +86 -47
- data/config/locales/fat_free_crm.en-GB.yml +5 -5
- data/config/locales/fat_free_crm.en-US.yml +5 -5
- data/config/locales/fat_free_crm.fr.yml +1 -1
- data/config/locales/fat_free_crm.ru.yml +2 -0
- data/config/routes.rb +20 -9
- data/config/settings.default.yml +0 -41
- data/db/demo/users.yml +62 -81
- data/db/migrate/20100928030620_remove_uuid.rb +1 -2
- data/db/migrate/20120316045804_activities_to_versions.rb +1 -0
- data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +1 -0
- data/db/migrate/20180107082701_authlogic_to_devise.rb +58 -0
- data/db/migrate/20200806004152_add_pattern_to_fields.rb +7 -0
- data/db/migrate/20200806004459_add_html5_to_fields.rb +10 -0
- data/db/schema.rb +58 -48
- data/docker-compose.yml +10 -0
- data/fat_free_crm.gemspec +13 -15
- data/lib/development_tasks/license.rake +2 -2
- data/lib/fat_free_crm/callback.rb +2 -2
- data/lib/fat_free_crm/comment_extensions.rb +2 -4
- data/lib/fat_free_crm/core_ext/string.rb +1 -1
- data/lib/fat_free_crm/core_ext.rb +1 -1
- data/lib/fat_free_crm/engine.rb +1 -1
- data/lib/fat_free_crm/errors.rb +1 -1
- data/lib/fat_free_crm/export_csv.rb +1 -0
- data/lib/fat_free_crm/exportable.rb +1 -1
- data/lib/fat_free_crm/fields.rb +1 -1
- data/lib/fat_free_crm/gem_dependencies.rb +1 -1
- data/lib/fat_free_crm/gem_ext.rb +0 -1
- data/lib/fat_free_crm/i18n.rb +2 -2
- data/lib/fat_free_crm/mail_processor/base.rb +4 -10
- data/lib/fat_free_crm/mail_processor/dropbox.rb +5 -15
- data/lib/fat_free_crm/permissions.rb +7 -4
- data/lib/fat_free_crm/sortable.rb +1 -1
- data/lib/fat_free_crm/tabs.rb +2 -2
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/gravatar_image_tag.rb +8 -9
- data/lib/missing_translation_detector.rb +1 -0
- data/lib/tasks/ffcrm/missing_translations.rake +1 -0
- data/lib/tasks/ffcrm/preference_update.rake +19 -0
- data/lib/tasks/ffcrm/setup.rake +11 -2
- data/lib/tasks/ffcrm/update_data.rake +2 -2
- data/lib/templates/erb/scaffold/_form.html.erb +4 -2
- data/script/rails +2 -2
- data/spec/controllers/admin/users_controller_spec.rb +0 -56
- data/spec/controllers/comments_controller_spec.rb +12 -12
- data/spec/controllers/entities/campaigns_controller_spec.rb +1 -1
- data/spec/controllers/entities/contacts_controller_spec.rb +2 -1
- data/spec/controllers/entities/leads_controller_spec.rb +2 -2
- data/spec/controllers/entities/opportunities_controller_spec.rb +1 -1
- data/spec/controllers/entities_controller_spec.rb +5 -0
- data/spec/controllers/home_controller_spec.rb +8 -8
- data/spec/controllers/tasks_controller_spec.rb +6 -4
- data/spec/controllers/users_controller_spec.rb +41 -99
- data/spec/factories/account_factories.rb +5 -5
- data/spec/factories/campaign_factories.rb +3 -3
- data/spec/factories/contact_factories.rb +8 -8
- data/spec/factories/field_factories.rb +4 -3
- data/spec/factories/lead_factories.rb +5 -5
- data/spec/factories/list_factories.rb +2 -2
- data/spec/factories/opportunity_factories.rb +3 -3
- data/spec/factories/setting_factories.rb +2 -2
- data/spec/factories/shared_factories.rb +11 -9
- data/spec/factories/task_factories.rb +7 -7
- data/spec/factories/user_factories.rb +21 -21
- data/spec/features/acceptance_helper.rb +1 -1
- data/spec/features/accounts_spec.rb +2 -2
- data/spec/features/admin/groups_spec.rb +2 -2
- data/spec/features/admin/users_spec.rb +4 -2
- data/spec/features/campaigns_spec.rb +3 -3
- data/spec/features/contacts_spec.rb +3 -6
- data/spec/features/dashboard_spec.rb +1 -1
- data/spec/features/devise/sign_in_spec.rb +58 -0
- data/spec/features/devise/sign_up_spec.rb +36 -0
- data/spec/features/leads_spec.rb +12 -8
- data/spec/features/opportunities_overview_spec.rb +1 -1
- data/spec/features/opportunities_spec.rb +7 -7
- data/spec/features/support/browser.rb +8 -3
- data/spec/features/support/selector_helpers.rb +10 -1
- data/spec/features/tasks_spec.rb +7 -7
- data/spec/helpers/accounts_helper_spec.rb +57 -0
- data/spec/helpers/admin/field_groups_helper_spec.rb +1 -1
- data/spec/helpers/users_helper_spec.rb +4 -4
- data/spec/lib/comment_extensions_spec.rb +10 -4
- data/spec/lib/errors_spec.rb +2 -2
- data/spec/lib/mail_processor/dropbox_spec.rb +1 -1
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +8 -8
- data/spec/lib/permissions_spec.rb +8 -3
- data/spec/mailers/devise_mailer_spec.rb +35 -0
- data/spec/mailers/user_mailer_spec.rb +0 -26
- data/spec/models/entities/account_spec.rb +27 -0
- data/spec/models/entities/contact_spec.rb +96 -1
- data/spec/models/entities/opportunity_spec.rb +2 -2
- data/spec/models/fields/custom_field_date_pair_spec.rb +4 -2
- data/spec/models/fields/custom_field_pair_spec.rb +2 -2
- data/spec/models/fields/custom_field_spec.rb +4 -2
- data/spec/models/observers/entity_observer_spec.rb +4 -4
- data/spec/models/polymorphic/task_spec.rb +11 -11
- data/spec/models/polymorphic/version_spec.rb +9 -9
- data/spec/models/users/preference_spec.rb +1 -1
- data/spec/models/users/user_spec.rb +22 -26
- data/spec/routing/users_routing_spec.rb +30 -8
- data/spec/shared/controllers.rb +3 -9
- data/spec/spec_helper.rb +10 -2
- data/spec/support/assert_select.rb +1 -0
- data/spec/support/devise_helpers.rb +28 -0
- data/spec/{features/support/helpers.rb → support/feature_helpers.rb} +10 -10
- data/spec/support/macros.rb +4 -1
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/_new.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +1 -2
- data/spec/views/accounts/update.js.haml_spec.rb +2 -5
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +0 -1
- data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -6
- data/spec/views/admin/users/update.js.haml_spec.rb +1 -2
- data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
- data/spec/views/campaigns/_new.haml_spec.rb +1 -1
- data/spec/views/campaigns/create.js.haml_spec.rb +1 -2
- data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/index.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/update.js.haml_spec.rb +3 -7
- data/spec/views/contacts/_edit.haml_spec.rb +1 -1
- data/spec/views/contacts/_new.haml_spec.rb +1 -1
- data/spec/views/contacts/create.js.haml_spec.rb +1 -2
- data/spec/views/contacts/edit.js.haml_spec.rb +1 -1
- data/spec/views/contacts/index.js.html_spec.rb +1 -1
- data/spec/views/contacts/update.js.haml_spec.rb +6 -10
- data/spec/views/home/index.haml_spec.rb +2 -2
- data/spec/views/leads/_edit.haml_spec.rb +1 -1
- data/spec/views/leads/_new.haml_spec.rb +1 -1
- data/spec/views/leads/create.js.haml_spec.rb +0 -3
- data/spec/views/leads/destroy.js.haml_spec.rb +0 -2
- data/spec/views/leads/promote.js.haml_spec.rb +3 -11
- data/spec/views/leads/reject.js.haml_spec.rb +0 -3
- data/spec/views/leads/update.js.haml_spec.rb +3 -11
- data/spec/views/opportunities/_edit.haml_spec.rb +1 -1
- data/spec/views/opportunities/_new.haml_spec.rb +1 -1
- data/spec/views/opportunities/create.js.haml_spec.rb +0 -2
- data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -3
- data/spec/views/opportunities/update.js.haml_spec.rb +4 -12
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/complete.js.haml_spec.rb +0 -1
- data/spec/views/tasks/create.js.haml_spec.rb +0 -2
- data/spec/views/tasks/destroy.js.haml_spec.rb +0 -1
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -1
- data/spec/views/tasks/update.js.haml_spec.rb +1 -4
- data/spec/views/users/change_password.js.haml_spec.rb +1 -2
- data/spec/views/users/update.js.haml_spec.rb +1 -2
- data/spec/views/users/upload_avatar.js.haml_spec.rb +1 -2
- metadata +63 -77
- data/app/controllers/authentications_controller.rb +0 -53
- data/app/models/users/authentication.rb +0 -56
- data/app/views/authentications/new.html.haml +0 -19
- data/app/views/passwords/edit.html.haml +0 -15
- data/app/views/passwords/new.html.haml +0 -10
- data/app/views/user_mailer/password_reset_instructions.html.haml +0 -6
- data/app/views/users/new.html.haml +0 -19
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +0 -26
- data/spec/controllers/authentications_controller_spec.rb +0 -150
- data/spec/controllers/passwords_controller_spec.rb +0 -32
- data/spec/models/users/authentication_spec.rb +0 -19
- data/spec/support/auth_macros.rb +0 -49
- data/spec/views/authentications/new.haml_spec.rb +0 -31
data/db/demo/users.yml
CHANGED
@@ -16,21 +16,18 @@
|
|
16
16
|
# yahoo :string(32)
|
17
17
|
# google :string(32)
|
18
18
|
# skype :string(32)
|
19
|
-
#
|
19
|
+
# encrypted_password :string(255) default(""), not null
|
20
20
|
# password_salt :string(255) default(""), not null
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# current_login_ip :string(255)
|
27
|
-
# login_count :integer default(0), not null
|
21
|
+
# last_sign_in_at :datetime
|
22
|
+
# current_sign_in_at :datetime
|
23
|
+
# last_sign_in_ip :string(255)
|
24
|
+
# current_sign_in_ip :string(255)
|
25
|
+
# sign_in_count :integer default(0), not null
|
28
26
|
# deleted_at :datetime
|
29
27
|
# created_at :datetime
|
30
28
|
# updated_at :datetime
|
31
29
|
# admin :boolean default(FALSE), not null
|
32
30
|
# suspended_at :datetime
|
33
|
-
# single_access_token :string(255)
|
34
31
|
#
|
35
32
|
|
36
33
|
<%
|
@@ -48,19 +45,17 @@ aaron:
|
|
48
45
|
phone: (800)555-1210
|
49
46
|
mobile: (800)555-1211
|
50
47
|
admin: true
|
51
|
-
|
48
|
+
encrypted_password: 56d91c9f1a9c549304768982fd4e2d8bc2700b403b4524c0f14136dbbe2ce4cd923156ad69f9acce8305dba4e63faa884e61fb7a256cf8f5fc7c2ce176e68e8f
|
52
49
|
password_salt: ce6e0200c96f4dd326b91f3967115a31421a0e7dcddc9ffb63a77f598a9fcb5326fe532dbd9836a2446e46840d398fa32c81f8f4da1a0fcfe931989e9639a013
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
last_login_ip: 127.0.0.1
|
59
|
-
current_login_ip: 127.0.0.1
|
60
|
-
login_count: <%= 1 + rand(100) %>
|
50
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
51
|
+
current_sign_in_at:
|
52
|
+
last_sign_in_ip: 127.0.0.1
|
53
|
+
current_sign_in_ip: 127.0.0.1
|
54
|
+
sign_in_count: <%= 1 + rand(100) %>
|
61
55
|
deleted_at:
|
62
56
|
created_at: <%= login - rand(5).days %>
|
63
57
|
updated_at: <%= login + rand(5).days %>
|
58
|
+
confirmed_at: <%= Time.now.utc %>
|
64
59
|
|
65
60
|
ben:
|
66
61
|
id: 2
|
@@ -74,19 +69,17 @@ ben:
|
|
74
69
|
phone: (800)555-1220
|
75
70
|
mobile: (800)555-1221
|
76
71
|
admin: true
|
77
|
-
|
72
|
+
encrypted_password: 3b23bde6e4f766450a36f30c5076db4164ab4edf957fe602858086feb833251149a2505b8ec00330fa6d9b531ff32ec7619b2b413b5c5380007c4a021f3546c2
|
78
73
|
password_salt: fce13d8b784003b4fb8d030866b5c3a003a914b9d52832d02b5f85db53413bcc8dd078d3e57e6c50b9bb8e8eb520e04a5f79cfb089a8bbe224e15e840b0dc594
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
last_login_ip: 127.0.0.1
|
85
|
-
current_login_ip: 127.0.0.1
|
86
|
-
login_count: <%= 1 + rand(100) %>
|
74
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
75
|
+
current_sign_in_at:
|
76
|
+
last_sign_in_ip: 127.0.0.1
|
77
|
+
current_sign_in_ip: 127.0.0.1
|
78
|
+
sign_in_count: <%= 1 + rand(100) %>
|
87
79
|
deleted_at:
|
88
80
|
created_at: <%= login - rand(5).days %>
|
89
81
|
updated_at: <%= login + rand(5).days %>
|
82
|
+
confirmed_at: <%= Time.now.utc %>
|
90
83
|
|
91
84
|
cindy:
|
92
85
|
id: 3
|
@@ -100,19 +93,17 @@ cindy:
|
|
100
93
|
phone: (800)555-1230
|
101
94
|
mobile: (800)555-1231
|
102
95
|
admin: true
|
103
|
-
|
96
|
+
encrypted_password: f323dc706086eeffee9997239f6fdfbd13ef0f62b0817cea1ef199912a64601e05e3a6c9074d2248b22e9e4ce5c817a9d9339839c2ae9502c9c1350f267f7b1f
|
104
97
|
password_salt: bc41b1a96c66ac155c79cf68ff3a16dd97d4730bc3476575fcab3c2ae7751776cc48e6faa036961be40ed04a27690b6f5189234968d4a6fff981105f040d9014
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
last_login_ip: 127.0.0.1
|
111
|
-
current_login_ip: 127.0.0.1
|
112
|
-
login_count: <%= 1 + rand(100) %>
|
98
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
99
|
+
current_sign_in_at:
|
100
|
+
last_sign_in_ip: 127.0.0.1
|
101
|
+
current_sign_in_ip: 127.0.0.1
|
102
|
+
sign_in_count: <%= 1 + rand(100) %>
|
113
103
|
deleted_at:
|
114
104
|
created_at: <%= login - rand(5).days %>
|
115
105
|
updated_at: <%= login + rand(5).days %>
|
106
|
+
confirmed_at: <%= Time.now.utc %>
|
116
107
|
|
117
108
|
dan:
|
118
109
|
id: 4
|
@@ -126,19 +117,17 @@ dan:
|
|
126
117
|
phone: (800)555-1240
|
127
118
|
mobile: (800)555-1241
|
128
119
|
admin: true
|
129
|
-
|
120
|
+
encrypted_password: 508f242629443dae3777e945d59213e7f81084be9f8c71b6d06b81295e9ffac145a3c2a8870cc17598e2a7908e2107f838d29ae275cfbe4a135c67c4f27e2e58
|
130
121
|
password_salt: e01633b1b2396fa3be0f689b87d68a55a831c043faffba0401131338e6aab5a8492a0b47a6947f0d96dd7188f51ecc530a2d72603802c7b409f1c42ce138de0b
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
last_login_ip: 127.0.0.1
|
137
|
-
current_login_ip: 127.0.0.1
|
138
|
-
login_count: <%= 1 + rand(100) %>
|
122
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
123
|
+
current_sign_in_at:
|
124
|
+
last_sign_in_ip: 127.0.0.1
|
125
|
+
current_sign_in_ip: 127.0.0.1
|
126
|
+
sign_in_count: <%= 1 + rand(100) %>
|
139
127
|
deleted_at:
|
140
128
|
created_at: <%= login - rand(5).days %>
|
141
129
|
updated_at: <%= login + rand(5).days %>
|
130
|
+
confirmed_at: <%= Time.now.utc %>
|
142
131
|
|
143
132
|
elizabeth:
|
144
133
|
id: 5
|
@@ -152,19 +141,17 @@ elizabeth:
|
|
152
141
|
phone: (800)555-1250
|
153
142
|
mobile: (800)555-1251
|
154
143
|
admin: true
|
155
|
-
|
144
|
+
encrypted_password: 5e90a6f2f5be66010c8a0eb6f2089780f453d1400e3aa4d271520f8e2a2e26d00d98d3ae2ba36854b897cbbe1f51343f4e9ce96dd4da8705ba3db5bd8b0ed0e7
|
156
145
|
password_salt: 80caf26a2981892f70acbc0ddb8fdd19c789163bfdefa3809355aef4bd989c8c6aa251c05b0923ef307e7b5269b6efdca380b0c28b8bf8f72ee5385a8557ed9b
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
last_login_ip: 127.0.0.1
|
163
|
-
current_login_ip: 127.0.0.1
|
164
|
-
login_count: <%= 1 + rand(100) %>
|
146
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
147
|
+
current_sign_in_at:
|
148
|
+
last_sign_in_ip: 127.0.0.1
|
149
|
+
current_sign_in_ip: 127.0.0.1
|
150
|
+
sign_in_count: <%= 1 + rand(100) %>
|
165
151
|
deleted_at:
|
166
152
|
created_at: <%= login - rand(5).days %>
|
167
153
|
updated_at: <%= login + rand(5).days %>
|
154
|
+
confirmed_at: <%= Time.now.utc %>
|
168
155
|
|
169
156
|
frank:
|
170
157
|
id: 6
|
@@ -178,19 +165,17 @@ frank:
|
|
178
165
|
phone: (800)555-1260
|
179
166
|
mobile: (800)555-1261
|
180
167
|
admin: true
|
181
|
-
|
168
|
+
encrypted_password: 1471e9dc79b636f465a529d89460fcefc8dbb0d2a14308349bd060d00dab4d35f1d91d201dbe37da4aa8c18a4430a09a6bca5babe05fb18ef3f02342dcf4e4ca
|
182
169
|
password_salt: 805983077fdba9438de1d84007e093f658620211e1d0087d33662a5ca387b04206d098e152aeea896ab65aa026ac1fb9ce69dbe22a45fb9b21c3b6dcad4909f3
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
last_login_ip: 127.0.0.1
|
189
|
-
current_login_ip: 127.0.0.1
|
190
|
-
login_count: <%= 1 + rand(100) %>
|
170
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
171
|
+
current_sign_in_at:
|
172
|
+
last_sign_in_ip: 127.0.0.1
|
173
|
+
current_sign_in_ip: 127.0.0.1
|
174
|
+
sign_in_count: <%= 1 + rand(100) %>
|
191
175
|
deleted_at:
|
192
176
|
created_at: <%= login - rand(5).days %>
|
193
177
|
updated_at: <%= login + rand(5).days %>
|
178
|
+
confirmed_at: <%= Time.now.utc %>
|
194
179
|
|
195
180
|
george:
|
196
181
|
id: 7
|
@@ -204,19 +189,17 @@ george:
|
|
204
189
|
phone: (800)555-1270
|
205
190
|
mobile: (800)555-1271
|
206
191
|
admin: true
|
207
|
-
|
192
|
+
encrypted_password: 23ed19767095ab24c1c560393b5a577455ab49d595781f931905f0df072533c485b1902337ffb426dae1e70889557f5b531da8e7b782a0575cc7bd419d6a91b9
|
208
193
|
password_salt: 80b5c87fb4c9fa5c50815016bc0160eb08c4e22e88fee558b5e739557d5178c61b06fcbebf6c4c62f37f0f7984ccc0d025e2f073880cd655b57542343e4981b6
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
last_login_ip: 127.0.0.1
|
215
|
-
current_login_ip: 127.0.0.1
|
216
|
-
login_count: <%= 1 + rand(100) %>
|
194
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
195
|
+
current_sign_in_at:
|
196
|
+
last_sign_in_ip: 127.0.0.1
|
197
|
+
current_sign_in_ip: 127.0.0.1
|
198
|
+
sign_in_count: <%= 1 + rand(100) %>
|
217
199
|
deleted_at:
|
218
200
|
created_at: <%= login - rand(5).days %>
|
219
201
|
updated_at: <%= login + rand(5).days %>
|
202
|
+
confirmed_at: <%= Time.now.utc %>
|
220
203
|
|
221
204
|
heather:
|
222
205
|
id: 8
|
@@ -230,16 +213,14 @@ heather:
|
|
230
213
|
phone: (800)555-1280
|
231
214
|
mobile: (800)555-1281
|
232
215
|
admin: true
|
233
|
-
|
216
|
+
encrypted_password: cdd2e9ec69c553c1f690b885c1cd1fd4e976c94a28693b793eba41796b0a96ce6f7cdd05ded8a84b30a96a37d18ad7fddd7435314bd612d033ead1c43bcde4d2
|
234
217
|
password_salt: 729ab318245afa827a8c29e36c885c7b0d07e15193727b68a7cf5edac517e4d6fcafa4e5ddfff9c9305d3ccd37ef735823ba66ba8e2876fd2b06c7c27f3c9482
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
last_login_ip: 127.0.0.1
|
241
|
-
current_login_ip: 127.0.0.1
|
242
|
-
login_count: <%= 1 + rand(100) %>
|
218
|
+
last_sign_in_at: <%= login = Date.today - rand(15).days %>
|
219
|
+
current_sign_in_at:
|
220
|
+
last_sign_in_ip: 127.0.0.1
|
221
|
+
current_sign_in_ip: 127.0.0.1
|
222
|
+
sign_in_count: <%= 1 + rand(100) %>
|
243
223
|
deleted_at:
|
244
224
|
created_at: <%= login - rand(5).days %>
|
245
225
|
updated_at: <%= login + rand(5).days %>
|
226
|
+
confirmed_at: <%= Time.now.utc %>
|
@@ -14,10 +14,9 @@ class RemoveUuid < ActiveRecord::Migration[4.2]
|
|
14
14
|
raise ActiveRecord::IrreversibleMigration, "Can't recover deleted UUIDs"
|
15
15
|
end
|
16
16
|
|
17
|
-
private
|
18
|
-
|
19
17
|
def self.uuid_configured?
|
20
18
|
return @@uuid_configured if @@uuid_configured
|
19
|
+
|
21
20
|
config = ActiveRecord::Base.connection.instance_variable_get("@config")
|
22
21
|
@@uuid_configured = config[:uuid]
|
23
22
|
end
|
@@ -18,6 +18,7 @@ class ActivitiesToVersions < ActiveRecord::Migration[4.2]
|
|
18
18
|
activities.each do |activity|
|
19
19
|
# commented and email activities don't translate well so ignore them
|
20
20
|
next unless event = events[activity['action']]
|
21
|
+
|
21
22
|
attributes = {
|
22
23
|
item_id: activity['subject_id'],
|
23
24
|
item_type: activity['subject_type'],
|
@@ -15,6 +15,7 @@ class AddNotNullConstraintsForTimestampColumns < ActiveRecord::Migration[4.2]
|
|
15
15
|
ActiveRecord::Base.connection.tables.each do |table|
|
16
16
|
# If table has both timestamp columns, set not null constraints on both columns.
|
17
17
|
next unless %i[created_at updated_at].all? { |column| column_exists?(table, column) }
|
18
|
+
|
18
19
|
%i[created_at updated_at].each do |column|
|
19
20
|
change_column table, column, :datetime, constraints
|
20
21
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AuthlogicToDevise < ActiveRecord::Migration[5.1]
|
4
|
+
def self.up
|
5
|
+
add_column :users, :unconfirmed_email, :string, limit: 254
|
6
|
+
add_column :users, :reset_password_token, :string
|
7
|
+
add_column :users, :reset_password_sent_at, :datetime
|
8
|
+
add_column :users, :remember_token, :string
|
9
|
+
add_column :users, :remember_created_at, :datetime
|
10
|
+
add_column :users, :authentication_token, :string
|
11
|
+
add_column :users, :confirmation_token, :string, limit: 255
|
12
|
+
add_column :users, :confirmed_at, :timestamp
|
13
|
+
add_column :users, :confirmation_sent_at, :timestamp
|
14
|
+
execute "UPDATE users SET confirmed_at = created_at, confirmation_sent_at = created_at"
|
15
|
+
|
16
|
+
rename_column :users, :password_hash, :encrypted_password
|
17
|
+
|
18
|
+
rename_column :users, :current_login_at, :current_sign_in_at
|
19
|
+
rename_column :users, :last_login_at, :last_sign_in_at
|
20
|
+
rename_column :users, :current_login_ip, :current_sign_in_ip
|
21
|
+
rename_column :users, :last_login_ip, :last_sign_in_ip
|
22
|
+
rename_column :users, :login_count, :sign_in_count
|
23
|
+
|
24
|
+
remove_column :users, :persistence_token
|
25
|
+
remove_column :users, :single_access_token
|
26
|
+
remove_column :users, :perishable_token
|
27
|
+
|
28
|
+
add_index :users, :reset_password_token, unique: true
|
29
|
+
add_index :users, :remember_token, unique: true
|
30
|
+
add_index :users, :confirmation_token, unique: true
|
31
|
+
add_index :users, :authentication_token, unique: true
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.down
|
35
|
+
add_column :users, :perishable_token, :string
|
36
|
+
add_column :users, :single_access_token, :string
|
37
|
+
add_column :users, :persistence_token, :string
|
38
|
+
|
39
|
+
rename_column :users, :encrypted_password, :password_hash
|
40
|
+
|
41
|
+
rename_column :users, :current_sign_in_at, :current_login_at
|
42
|
+
rename_column :users, :last_sign_in_at, :last_login_at
|
43
|
+
rename_column :users, :current_sign_in_ip, :current_login_ip
|
44
|
+
rename_column :users, :last_sign_in_ip, :last_login_ip
|
45
|
+
rename_column :users, :sign_in_count, :login_count
|
46
|
+
|
47
|
+
remove_column :users, :confirmation_token
|
48
|
+
remove_column :users, :confirmed_at
|
49
|
+
remove_column :users, :confirmation_sent_at
|
50
|
+
|
51
|
+
remove_column :users, :unconfirmed_email
|
52
|
+
remove_column :users, :authentication_token
|
53
|
+
remove_column :users, :remember_created_at
|
54
|
+
remove_column :users, :remember_token
|
55
|
+
remove_column :users, :reset_password_sent_at
|
56
|
+
remove_column :users, :reset_password_token
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddHtml5ToFields < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_column :fields, :autofocus, :string
|
6
|
+
add_column :fields, :autocomplete, :string
|
7
|
+
add_column :fields, :list, :string
|
8
|
+
add_column :fields, :multiple, :string
|
9
|
+
end
|
10
|
+
end
|
data/db/schema.rb
CHANGED
@@ -2,20 +2,17 @@
|
|
2
2
|
# of editing this file, please use the migrations feature of Active Record to
|
3
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
4
4
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# from scratch.
|
9
|
-
#
|
5
|
+
# This file is the source Rails uses to define your schema when running `rails
|
6
|
+
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
+
# migrations use external dependencies or application code.
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 2020_08_06_004459) do
|
14
14
|
|
15
|
-
|
16
|
-
enable_extension "plpgsql"
|
17
|
-
|
18
|
-
create_table "account_contacts", id: :serial, force: :cascade do |t|
|
15
|
+
create_table "account_contacts", force: :cascade do |t|
|
19
16
|
t.integer "account_id"
|
20
17
|
t.integer "contact_id"
|
21
18
|
t.datetime "deleted_at"
|
@@ -24,7 +21,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
24
21
|
t.index ["account_id", "contact_id"], name: "index_account_contacts_on_account_id_and_contact_id"
|
25
22
|
end
|
26
23
|
|
27
|
-
create_table "account_opportunities",
|
24
|
+
create_table "account_opportunities", force: :cascade do |t|
|
28
25
|
t.integer "account_id"
|
29
26
|
t.integer "opportunity_id"
|
30
27
|
t.datetime "deleted_at"
|
@@ -33,7 +30,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
33
30
|
t.index ["account_id", "opportunity_id"], name: "index_account_opportunities_on_account_id_and_opportunity_id"
|
34
31
|
end
|
35
32
|
|
36
|
-
create_table "accounts",
|
33
|
+
create_table "accounts", force: :cascade do |t|
|
37
34
|
t.integer "user_id"
|
38
35
|
t.integer "assigned_to"
|
39
36
|
t.string "name", limit: 64, default: "", null: false
|
@@ -56,7 +53,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
56
53
|
t.index ["user_id", "name", "deleted_at"], name: "index_accounts_on_user_id_and_name_and_deleted_at", unique: true
|
57
54
|
end
|
58
55
|
|
59
|
-
create_table "activities",
|
56
|
+
create_table "activities", force: :cascade do |t|
|
60
57
|
t.integer "user_id"
|
61
58
|
t.string "subject_type"
|
62
59
|
t.integer "subject_id"
|
@@ -69,7 +66,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
69
66
|
t.index ["user_id"], name: "index_activities_on_user_id"
|
70
67
|
end
|
71
68
|
|
72
|
-
create_table "addresses",
|
69
|
+
create_table "addresses", force: :cascade do |t|
|
73
70
|
t.string "street1"
|
74
71
|
t.string "street2"
|
75
72
|
t.string "city", limit: 64
|
@@ -86,7 +83,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
86
83
|
t.index ["addressable_id", "addressable_type"], name: "index_addresses_on_addressable_id_and_addressable_type"
|
87
84
|
end
|
88
85
|
|
89
|
-
create_table "avatars",
|
86
|
+
create_table "avatars", force: :cascade do |t|
|
90
87
|
t.integer "user_id"
|
91
88
|
t.string "entity_type"
|
92
89
|
t.integer "entity_id"
|
@@ -97,7 +94,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
97
94
|
t.datetime "updated_at"
|
98
95
|
end
|
99
96
|
|
100
|
-
create_table "campaigns",
|
97
|
+
create_table "campaigns", force: :cascade do |t|
|
101
98
|
t.integer "user_id"
|
102
99
|
t.integer "assigned_to"
|
103
100
|
t.string "name", limit: 64, default: "", null: false
|
@@ -122,7 +119,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
122
119
|
t.index ["user_id", "name", "deleted_at"], name: "index_campaigns_on_user_id_and_name_and_deleted_at", unique: true
|
123
120
|
end
|
124
121
|
|
125
|
-
create_table "comments",
|
122
|
+
create_table "comments", force: :cascade do |t|
|
126
123
|
t.integer "user_id"
|
127
124
|
t.string "commentable_type"
|
128
125
|
t.integer "commentable_id"
|
@@ -134,7 +131,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
134
131
|
t.string "state", limit: 16, default: "Expanded", null: false
|
135
132
|
end
|
136
133
|
|
137
|
-
create_table "contact_opportunities",
|
134
|
+
create_table "contact_opportunities", force: :cascade do |t|
|
138
135
|
t.integer "contact_id"
|
139
136
|
t.integer "opportunity_id"
|
140
137
|
t.string "role", limit: 32
|
@@ -144,7 +141,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
144
141
|
t.index ["contact_id", "opportunity_id"], name: "index_contact_opportunities_on_contact_id_and_opportunity_id"
|
145
142
|
end
|
146
143
|
|
147
|
-
create_table "contacts",
|
144
|
+
create_table "contacts", force: :cascade do |t|
|
148
145
|
t.integer "user_id"
|
149
146
|
t.integer "lead_id"
|
150
147
|
t.integer "assigned_to"
|
@@ -176,7 +173,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
176
173
|
t.index ["user_id", "last_name", "deleted_at"], name: "id_last_name_deleted", unique: true
|
177
174
|
end
|
178
175
|
|
179
|
-
create_table "emails",
|
176
|
+
create_table "emails", force: :cascade do |t|
|
180
177
|
t.string "imap_message_id", null: false
|
181
178
|
t.integer "user_id"
|
182
179
|
t.string "mediator_type"
|
@@ -197,7 +194,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
197
194
|
t.index ["mediator_id", "mediator_type"], name: "index_emails_on_mediator_id_and_mediator_type"
|
198
195
|
end
|
199
196
|
|
200
|
-
create_table "field_groups",
|
197
|
+
create_table "field_groups", force: :cascade do |t|
|
201
198
|
t.string "name", limit: 64
|
202
199
|
t.string "label", limit: 128
|
203
200
|
t.integer "position"
|
@@ -208,7 +205,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
208
205
|
t.string "klass_name", limit: 32
|
209
206
|
end
|
210
207
|
|
211
|
-
create_table "fields",
|
208
|
+
create_table "fields", force: :cascade do |t|
|
212
209
|
t.string "type"
|
213
210
|
t.integer "field_group_id"
|
214
211
|
t.integer "position"
|
@@ -220,17 +217,22 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
220
217
|
t.text "collection"
|
221
218
|
t.boolean "disabled"
|
222
219
|
t.boolean "required"
|
223
|
-
t.integer "maxlength"
|
220
|
+
t.integer "maxlength", limit: 4
|
224
221
|
t.datetime "created_at"
|
225
222
|
t.datetime "updated_at"
|
226
223
|
t.integer "pair_id"
|
227
224
|
t.text "settings"
|
228
|
-
t.integer "minlength", default: 0
|
225
|
+
t.integer "minlength", limit: 4, default: 0
|
226
|
+
t.string "pattern"
|
227
|
+
t.string "autofocus"
|
228
|
+
t.string "autocomplete"
|
229
|
+
t.string "list"
|
230
|
+
t.string "multiple"
|
229
231
|
t.index ["field_group_id"], name: "index_fields_on_field_group_id"
|
230
232
|
t.index ["name"], name: "index_fields_on_name"
|
231
233
|
end
|
232
234
|
|
233
|
-
create_table "groups",
|
235
|
+
create_table "groups", force: :cascade do |t|
|
234
236
|
t.string "name"
|
235
237
|
t.datetime "created_at"
|
236
238
|
t.datetime "updated_at"
|
@@ -244,7 +246,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
244
246
|
t.index ["user_id"], name: "index_groups_users_on_user_id"
|
245
247
|
end
|
246
248
|
|
247
|
-
create_table "leads",
|
249
|
+
create_table "leads", force: :cascade do |t|
|
248
250
|
t.integer "user_id"
|
249
251
|
t.integer "campaign_id"
|
250
252
|
t.integer "assigned_to"
|
@@ -276,7 +278,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
276
278
|
t.index ["user_id", "last_name", "deleted_at"], name: "index_leads_on_user_id_and_last_name_and_deleted_at", unique: true
|
277
279
|
end
|
278
280
|
|
279
|
-
create_table "lists",
|
281
|
+
create_table "lists", force: :cascade do |t|
|
280
282
|
t.string "name"
|
281
283
|
t.text "url"
|
282
284
|
t.datetime "created_at"
|
@@ -285,7 +287,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
285
287
|
t.index ["user_id"], name: "index_lists_on_user_id"
|
286
288
|
end
|
287
289
|
|
288
|
-
create_table "opportunities",
|
290
|
+
create_table "opportunities", force: :cascade do |t|
|
289
291
|
t.integer "user_id"
|
290
292
|
t.integer "campaign_id"
|
291
293
|
t.integer "assigned_to"
|
@@ -306,7 +308,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
306
308
|
t.index ["user_id", "name", "deleted_at"], name: "id_name_deleted", unique: true
|
307
309
|
end
|
308
310
|
|
309
|
-
create_table "permissions",
|
311
|
+
create_table "permissions", force: :cascade do |t|
|
310
312
|
t.integer "user_id"
|
311
313
|
t.string "asset_type"
|
312
314
|
t.integer "asset_id"
|
@@ -318,7 +320,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
318
320
|
t.index ["user_id"], name: "index_permissions_on_user_id"
|
319
321
|
end
|
320
322
|
|
321
|
-
create_table "preferences",
|
323
|
+
create_table "preferences", force: :cascade do |t|
|
322
324
|
t.integer "user_id"
|
323
325
|
t.string "name", limit: 32, default: "", null: false
|
324
326
|
t.text "value"
|
@@ -327,7 +329,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
327
329
|
t.index ["user_id", "name"], name: "index_preferences_on_user_id_and_name"
|
328
330
|
end
|
329
331
|
|
330
|
-
create_table "sessions",
|
332
|
+
create_table "sessions", force: :cascade do |t|
|
331
333
|
t.string "session_id", null: false
|
332
334
|
t.text "data"
|
333
335
|
t.datetime "created_at"
|
@@ -336,7 +338,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
336
338
|
t.index ["updated_at"], name: "index_sessions_on_updated_at"
|
337
339
|
end
|
338
340
|
|
339
|
-
create_table "settings",
|
341
|
+
create_table "settings", force: :cascade do |t|
|
340
342
|
t.string "name", limit: 32, default: "", null: false
|
341
343
|
t.text "value"
|
342
344
|
t.datetime "created_at"
|
@@ -344,7 +346,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
344
346
|
t.index ["name"], name: "index_settings_on_name"
|
345
347
|
end
|
346
348
|
|
347
|
-
create_table "taggings",
|
349
|
+
create_table "taggings", force: :cascade do |t|
|
348
350
|
t.integer "tag_id"
|
349
351
|
t.integer "taggable_id"
|
350
352
|
t.integer "tagger_id"
|
@@ -356,13 +358,13 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
356
358
|
t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
|
357
359
|
end
|
358
360
|
|
359
|
-
create_table "tags",
|
361
|
+
create_table "tags", force: :cascade do |t|
|
360
362
|
t.string "name"
|
361
363
|
t.integer "taggings_count", default: 0
|
362
364
|
t.index ["name"], name: "index_tags_on_name", unique: true
|
363
365
|
end
|
364
366
|
|
365
|
-
create_table "tasks",
|
367
|
+
create_table "tasks", force: :cascade do |t|
|
366
368
|
t.integer "user_id"
|
367
369
|
t.integer "assigned_to"
|
368
370
|
t.integer "completed_by"
|
@@ -383,7 +385,7 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
383
385
|
t.index ["user_id", "name", "deleted_at"], name: "index_tasks_on_user_id_and_name_and_deleted_at", unique: true
|
384
386
|
end
|
385
387
|
|
386
|
-
create_table "users",
|
388
|
+
create_table "users", force: :cascade do |t|
|
387
389
|
t.string "username", limit: 32, default: "", null: false
|
388
390
|
t.string "email", limit: 254, default: "", null: false
|
389
391
|
t.string "first_name", limit: 32
|
@@ -397,28 +399,36 @@ ActiveRecord::Schema.define(version: 20180103223438) do
|
|
397
399
|
t.string "yahoo", limit: 32
|
398
400
|
t.string "google", limit: 32
|
399
401
|
t.string "skype", limit: 32
|
400
|
-
t.string "
|
402
|
+
t.string "encrypted_password", default: "", null: false
|
401
403
|
t.string "password_salt", default: "", null: false
|
402
|
-
t.
|
403
|
-
t.
|
404
|
-
t.
|
405
|
-
t.
|
406
|
-
t.
|
407
|
-
t.string "current_login_ip"
|
408
|
-
t.integer "login_count", default: 0, null: false
|
404
|
+
t.datetime "last_sign_in_at"
|
405
|
+
t.datetime "current_sign_in_at"
|
406
|
+
t.string "last_sign_in_ip"
|
407
|
+
t.string "current_sign_in_ip"
|
408
|
+
t.integer "sign_in_count", default: 0, null: false
|
409
409
|
t.datetime "deleted_at"
|
410
410
|
t.datetime "created_at"
|
411
411
|
t.datetime "updated_at"
|
412
412
|
t.boolean "admin", default: false, null: false
|
413
413
|
t.datetime "suspended_at"
|
414
|
-
t.string "
|
414
|
+
t.string "unconfirmed_email", limit: 254
|
415
|
+
t.string "reset_password_token"
|
416
|
+
t.datetime "reset_password_sent_at"
|
417
|
+
t.string "remember_token"
|
418
|
+
t.datetime "remember_created_at"
|
419
|
+
t.string "authentication_token"
|
420
|
+
t.string "confirmation_token", limit: 255
|
421
|
+
t.datetime "confirmed_at"
|
422
|
+
t.datetime "confirmation_sent_at"
|
423
|
+
t.index ["authentication_token"], name: "index_users_on_authentication_token", unique: true
|
424
|
+
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
415
425
|
t.index ["email"], name: "index_users_on_email"
|
416
|
-
t.index ["
|
417
|
-
t.index ["
|
426
|
+
t.index ["remember_token"], name: "index_users_on_remember_token", unique: true
|
427
|
+
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
418
428
|
t.index ["username", "deleted_at"], name: "index_users_on_username_and_deleted_at", unique: true
|
419
429
|
end
|
420
430
|
|
421
|
-
create_table "versions",
|
431
|
+
create_table "versions", force: :cascade do |t|
|
422
432
|
t.string "item_type", null: false
|
423
433
|
t.integer "item_id", null: false
|
424
434
|
t.string "event", limit: 512, null: false
|