Class: CASServer::Models::CreateCASServer

Inherits:
V
  • Object
show all
Defined in:
lib/casserver/models.rb

Class Method Summary collapse

Class Method Details

.downObject



148
149
150
151
152
153
154
155
# File 'lib/casserver/models.rb', line 148

def self.down
  if ActiveRecord::Base.connection.table_alias_length > 30
    drop_table :casserver_proxy_granting_tickets
    drop_table :casserver_ticket_granting_tickets
    drop_table :casserver_service_tickets
    drop_table :casserver_login_tickets
  end
end

.upObject



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/casserver/models.rb', line 109

def self.up
  if ActiveRecord::Base.connection.table_alias_length > 30
    $LOG.info("Creating database with long table names...")

    create_table :casserver_login_tickets, :force => true do |t|
      t.column :ticket,     :string,   :null => false
      t.column :created_on, :timestamp, :null => false
      t.column :consumed,   :datetime, :null => true
      t.column :client_hostname, :string, :null => false
    end

    create_table :casserver_service_tickets, :force => true do |t|
      t.column :ticket,     :string,    :null => false
      t.column :service,    :string,    :null => false
      t.column :created_on, :timestamp, :null => false
      t.column :consumed,   :datetime, :null => true
      t.column :client_hostname, :string, :null => false
      t.column :username,   :string,  :null => false
      t.column :type,       :string,   :null => false
      t.column :proxy_granting_ticket_id, :integer, :null => true
    end

    create_table :casserver_ticket_granting_tickets, :force => true do |t|
      t.column :ticket,     :string,    :null => false
      t.column :created_on, :timestamp, :null => false
      t.column :client_hostname, :string, :null => false
      t.column :username,   :string,    :null => false
    end

    create_table :casserver_proxy_granting_tickets, :force => true do |t|
      t.column :ticket,     :string,    :null => false
      t.column :created_on, :timestamp, :null => false
      t.column :client_hostname, :string, :null => false
      t.column :iou,        :string,    :null => false
      t.column :service_ticket_id, :integer, :null => false
    end
  end
end