mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 15:16:09 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
22 lines
607 B
Ruby
22 lines
607 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddUserApiKeys < ActiveRecord::Migration[4.2]
|
|
def change
|
|
create_table :user_api_keys do |t|
|
|
t.integer :user_id, null: false
|
|
t.string :client_id, null: false
|
|
t.string :key, null: false
|
|
t.string :application_name, null: false
|
|
t.boolean :read, null: false
|
|
t.boolean :write, null: false
|
|
t.boolean :push, null: false
|
|
t.string :push_url
|
|
t.timestamps null: false
|
|
end
|
|
|
|
add_index :user_api_keys, [:key], unique: true
|
|
add_index :user_api_keys, [:user_id]
|
|
add_index :user_api_keys, [:client_id]
|
|
end
|
|
end
|