"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20170116000001_add_ticket_time_accounting_373.rb" (25 Mar 2021, 984 Bytes) of package /linux/www/zammad-4.0.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "20170116000001_add_ticket_time_accounting_373.rb": 3.4.1_vs_3.5.0.

    1 class AddTicketTimeAccounting373 < ActiveRecord::Migration[4.2]
    2   def up
    3 
    4     # return if it's a new setup
    5     return if !Setting.exists?(name: 'system_init_done')
    6 
    7     drop_table :ticket_time_accounting
    8     create_table :ticket_time_accountings do |t|
    9       t.references :ticket,                                       null: false
   10       t.references :ticket_article,                               null: true
   11       t.column :time_unit,      :decimal, precision: 6, scale: 2, null: false
   12       t.column :created_by_id,  :integer,                         null: false
   13       t.timestamps limit: 3, null: false
   14     end
   15     add_index :ticket_time_accountings, [:ticket_id]
   16     add_index :ticket_time_accountings, [:ticket_article_id]
   17     add_index :ticket_time_accountings, [:created_by_id]
   18     add_index :ticket_time_accountings, [:time_unit]
   19 
   20     add_column :tickets, :time_unit, :decimal, precision: 6, scale: 2, null: true
   21     add_index :tickets, [:time_unit]
   22 
   23     Cache.clear
   24   end
   25 end