Class: SelfRegistration

Inherits:
ActiveRecord::Migration
  • Object
show all
Includes:
Goldberg::Migration
Defined in:
lib/six-updater-web/vendor/plugins/goldberg/db/migrate/003_self_registration.rb

Class Method Summary collapse

Methods included from Goldberg::Migration

dump_bootstrap, dump_for_class, goldberg_classes, included, load_bootstrap, load_for_class

Class Method Details

.downObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/six-updater-web/vendor/plugins/goldberg/db/migrate/003_self_registration.rb', line 31

def self.down
  remove_column "#{prefix}content_pages", "markup_style"
  
  remove_column "#{prefix}users", "password_expired"
  remove_column "#{prefix}users", "password_changed_at"
  remove_column "#{prefix}users", "confirmation_key"
  remove_column "#{prefix}users", "self_reg_confirmation_required"
  remove_column "#{prefix}users", "start_path"

  remove_column "#{prefix}roles", "start_path"
  
  remove_column "#{prefix}system_settings", "self_reg_send_confirmation_email"
  remove_column "#{prefix}system_settings",
  "self_reg_confirmation_error_page_id"
  remove_column "#{prefix}system_settings", "self_reg_confirmation_required"
  remove_column "#{prefix}system_settings", "self_reg_role_id"
  remove_column "#{prefix}system_settings", "self_reg_enabled"
  remove_column "#{prefix}system_settings", "site_url_prefix"
  remove_column "#{prefix}system_settings", "start_path"
end

.upObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/six-updater-web/vendor/plugins/goldberg/db/migrate/003_self_registration.rb', line 4

def self.up
  # Add fields to SystemSettings to support self registration
  add_column "#{prefix}system_settings", "start_path", :string
  add_column "#{prefix}system_settings", "site_url_prefix", :string
  add_column "#{prefix}system_settings", "self_reg_enabled", :boolean
  add_column "#{prefix}system_settings", "self_reg_role_id", :integer
  add_column "#{prefix}system_settings",
  "self_reg_confirmation_required", :boolean
  add_column "#{prefix}system_settings",
  "self_reg_confirmation_error_page_id", :integer
  add_column "#{prefix}system_settings",
  "self_reg_send_confirmation_email", :boolean

  # Role
  add_column "#{prefix}roles", "start_path", :string
  
  # User
  add_column "#{prefix}users", "start_path", :string
  add_column "#{prefix}users", "self_reg_confirmation_required", :boolean
  add_column "#{prefix}users", "confirmation_key", :string
  add_column "#{prefix}users", "password_changed_at", :timestamp
  add_column "#{prefix}users", "password_expired", :boolean

  # ContentPage
  add_column "#{prefix}content_pages", "markup_style", :string
end