Browse Source

Some datables cleanups.

Martin Edenhofer 12 years ago
parent
commit
4a6681697f

+ 1 - 1
app/assets/javascripts/app/controllers/_application_controller_form.js.coffee

@@ -7,7 +7,7 @@ class App.ControllerForm extends App.Controller
     @form = @formGen()
 #    @log 'form', @form
     if @el
-      @el.append( @form )
+      @el.prepend( @form )
 
   html: =>
     @form.html()

+ 3 - 1
app/controllers/users_controller.rb

@@ -116,10 +116,10 @@ curl http://localhost/api/users.json -v -u #{login}:#{password} -H "Content-Type
 
   def create
     user = User.new( User.param_cleanup(params) )
+    user.updated_by_id = (current_user && current_user.id) || 1
     user.created_by_id = (current_user && current_user.id) || 1
     
     begin
-      user.save
 
       # if it's a signup, add user to customer role
       if user.created_by_id == 1
@@ -155,6 +155,8 @@ curl http://localhost/api/users.json -v -u #{login}:#{password} -H "Content-Type
         end
       end
 
+      user.save
+
       # send inviteation if needed
       if params[:invite]
 

+ 14 - 2
db/migrate/20120101000001_create_base.rb

@@ -73,8 +73,8 @@ class CreateBase < ActiveRecord::Migration
       t.references :email_address,                             :null => true
       t.column :name,                 :string,  :limit => 100, :null => false
       t.column :assignment_timeout,   :integer,                :null => true
-      t.column :follow_up_possible,   :string,  :limit => 100, :default => 'yes', :null => true
-      t.column :follow_up_assignment, :boolean, :default => 1
+      t.column :follow_up_possible,   :string,  :limit => 100, :null => false, :default => 'yes'
+      t.column :follow_up_assignment, :boolean,                :null => false, :default => true
       t.column :active,               :boolean,                :null => false, :default => true
       t.column :note,                 :string,  :limit => 250, :null => true
       t.column :updated_by_id,        :integer,                :null => false
@@ -132,6 +132,18 @@ class CreateBase < ActiveRecord::Migration
     add_index :authorizations, [:user_id]
     add_index :authorizations, [:username]
 
+    create_table :translations do |t|
+      t.column :locale,               :string,  :limit => 10,   :null => false
+      t.column :source,               :string,  :limit => 255,  :null => false
+      t.column :target,               :string,  :limit => 255,  :null => false
+      t.column :target_initial,       :string,  :limit => 255,  :null => false
+      t.column :updated_by_id,        :integer,                 :null => false
+      t.column :created_by_id,        :integer,                 :null => false
+      t.timestamps
+    end
+    add_index :translations, [:source]
+    add_index :translations, [:locale]
+
   end
 end
 

+ 1 - 1
db/migrate/20120101000010_create_ticket.rb

@@ -210,7 +210,7 @@ class CreateTicket < ActiveRecord::Migration
       t.column :link_object_target_value,     :integer,               :null => false
       t.timestamps
     end
-    add_index :links, [:link_object_source_id, :link_object_source_value, :link_object_target_id, :link_object_target_value, :link_types_id], :unique => true, :name => 'links_uniq_total'
+    add_index :links, [:link_object_source_id, :link_object_source_value, :link_object_target_id, :link_object_target_value, :link_type_id], :unique => true, :name => 'links_uniq_total'
   end
 
   def self.down

+ 0 - 19
db/migrate/20120101000100_create_translation.rb

@@ -1,19 +0,0 @@
-class CreateTranslation < ActiveRecord::Migration
-  def up
-    create_table :translations do |t|
-      t.column :locale,               :string,  :limit => 10,   :null => false
-      t.column :source,               :string,  :limit => 255,  :null => false
-      t.column :target,               :string,  :limit => 255,  :null => false
-      t.column :target_initial,       :string,  :limit => 255,  :null => false
-      t.column :updated_by_id,        :integer,               :null => false
-      t.column :created_by_id,        :integer,               :null => false
-      t.timestamps
-    end
-    add_index :translations, [:source]
-    add_index :translations, [:locale]
-  end
-
-  def down
-    drop_table :translations
-  end
-end

+ 0 - 0
db/migrate/20121008081936_postmaster_filter_create.rb → db/migrate/20120101000100_postmaster_filter_create.rb


+ 0 - 0
db/migrate/20121019140507_text_module_create.rb → db/migrate/20120101000110_text_module_create.rb


+ 0 - 22
db/migrate/20120825005823_group_update.rb

@@ -1,22 +0,0 @@
-class GroupUpdate < ActiveRecord::Migration
-  def up
-    # t.references :signature,                    :null => true
-    add_column :groups, :signature_id,          :integer, :null => true
-    add_column :groups, :assignment_timeout,    :integer, :null => true
-    add_column :groups, :follow_up_possible,    :string,  :limit => 100, :default => 'yes', :null => true
-    add_column :groups, :follow_up_assignment,  :boolean, :default => 1
-
-    create_table :signatures do |t|
-      t.column :name,           :string, :limit => 100,  :null => false
-      t.column :body,           :string, :limit => 5000, :null => true
-      t.column :active,         :boolean,                :null => false, :default => true
-      t.column :note,           :string, :limit => 250,  :null => true
-      t.column :created_by_id,  :integer,                :null => false
-      t.timestamps
-    end
-    add_index :signatures, [:name], :unique => true
-  end
-
-  def down
-  end
-end

+ 0 - 8
db/migrate/20120904192450_overview_update.rb

@@ -1,8 +0,0 @@
-class OverviewUpdate < ActiveRecord::Migration
-  def up
-    add_column :overviews, :role_id,          :integer, :null => true
-  end
-
-  def down
-  end
-end

+ 0 - 43
db/migrate/20120917161903_create_change_by_id.rb

@@ -1,43 +0,0 @@
-class CreateChangeById < ActiveRecord::Migration
-  def up
-    add_column :channels, :updated_by_id,          :integer, :null => true
-    add_column :overviews, :created_by_id,          :integer, :null => true
-    add_column :overviews, :updated_by_id,          :integer, :null => true
-    add_column :users, :updated_by_id,          :integer, :null => true
-    add_column :signatures, :updated_by_id,          :integer, :null => true
-    add_column :groups, :updated_by_id,          :integer, :null => true
-    add_column :roles, :updated_by_id,          :integer, :null => true
-    add_column :organizations, :updated_by_id,          :integer, :null => true
-    add_column :ticket_state_types, :updated_by_id,          :integer, :null => true
-    add_column :ticket_state_types, :created_by_id,          :integer, :null => true
-    add_column :ticket_states, :updated_by_id,          :integer, :null => true
-    add_column :ticket_states, :created_by_id,          :integer, :null => true
-    add_column :ticket_priorities, :updated_by_id,          :integer, :null => true
-    add_column :ticket_priorities, :created_by_id,          :integer, :null => true
-    add_column :tickets, :updated_by_id,          :integer, :null => true
-    add_column :ticket_article_types, :updated_by_id,          :integer, :null => true
-    add_column :ticket_article_types, :created_by_id,          :integer, :null => true
-    add_column :ticket_article_senders, :updated_by_id,          :integer, :null => true
-    add_column :ticket_article_senders, :created_by_id,          :integer, :null => true
-    add_column :ticket_articles, :updated_by_id,          :integer, :null => true
-    add_column :networks, :updated_by_id,          :integer, :null => true
-    add_column :networks, :created_by_id,          :integer, :null => true
-    add_column :network_category_types, :updated_by_id,          :integer, :null => true
-    add_column :network_category_types, :created_by_id,          :integer, :null => true
-    add_column :network_privacies, :updated_by_id,          :integer, :null => true
-    add_column :network_privacies, :created_by_id,          :integer, :null => true
-    add_column :network_categories, :updated_by_id,          :integer, :null => true
-    add_column :network_categories, :created_by_id,          :integer, :null => true
-    add_column :network_items, :updated_by_id,          :integer, :null => true
-    add_column :network_item_comments, :updated_by_id,          :integer, :null => true
-    add_column :network_item_plus, :updated_by_id,          :integer, :null => true
-    add_column :network_category_subscriptions, :updated_by_id,          :integer, :null => true
-    add_column :network_item_subscriptions, :updated_by_id,          :integer, :null => true
-    add_column :templates, :updated_by_id,          :integer, :null => true
-    add_column :translations, :created_by_id,          :integer, :null => true
-    add_column :translations, :updated_by_id,          :integer, :null => true
-  end
-
-  def down
-  end
-end

Some files were not shown because too many files changed in this diff