Commit b2264607 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Update packages db schema after db review

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent bc6cabf9
...@@ -1921,36 +1921,36 @@ ActiveRecord::Schema.define(version: 20180810155213) do ...@@ -1921,36 +1921,36 @@ ActiveRecord::Schema.define(version: 20180810155213) do
t.string "nonce", null: false t.string "nonce", null: false
end end
create_table "packages_maven_metadata", force: :cascade do |t| create_table "packages_maven_metadata", id: :bigserial, force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false t.datetime_with_timezone "updated_at", null: false
t.integer "package_id", null: false t.integer "package_id", null: false
t.string "path", null: false
t.string "app_group", null: false t.string "app_group", null: false
t.string "app_name", null: false t.string "app_name", null: false
t.string "app_version" t.string "app_version"
t.text "path", null: false
end end
add_index "packages_maven_metadata", ["package_id"], name: "index_packages_maven_metadata_on_package_id", using: :btree add_index "packages_maven_metadata", ["package_id"], name: "index_packages_maven_metadata_on_package_id", using: :btree
add_index "packages_maven_metadata", ["path"], name: "index_packages_maven_metadata_on_path", using: :btree add_index "packages_maven_metadata", ["path"], name: "index_packages_maven_metadata_on_path", using: :btree
create_table "packages_package_files", force: :cascade do |t| create_table "packages_package_files", id: :bigserial, force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false t.datetime_with_timezone "updated_at", null: false
t.integer "size", limit: 8
t.integer "package_id", null: false t.integer "package_id", null: false
t.integer "file_type" t.integer "file_type"
t.integer "file_store" t.integer "file_store"
t.integer "size"
t.binary "file_md5" t.binary "file_md5"
t.binary "file_sha1" t.binary "file_sha1"
t.string "file"
t.string "file_name", null: false t.string "file_name", null: false
t.text "file", null: false
end end
add_index "packages_package_files", ["package_id", "file_name"], name: "index_packages_package_files_on_package_id_and_file_name", using: :btree add_index "packages_package_files", ["package_id", "file_name"], name: "index_packages_package_files_on_package_id_and_file_name", using: :btree
add_index "packages_package_files", ["package_id"], name: "index_packages_package_files_on_package_id", using: :btree add_index "packages_package_files", ["package_id"], name: "index_packages_package_files_on_package_id", using: :btree
create_table "packages_packages", force: :cascade do |t| create_table "packages_packages", id: :bigserial, force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false t.datetime_with_timezone "updated_at", null: false
t.integer "project_id", null: false t.integer "project_id", null: false
......
...@@ -7,7 +7,7 @@ class CreatePackagesPackages < ActiveRecord::Migration ...@@ -7,7 +7,7 @@ class CreatePackagesPackages < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def change def change
create_table :packages_packages do |t| create_table :packages_packages, id: :bigserial do |t|
t.timestamps_with_timezone null: false t.timestamps_with_timezone null: false
t.references :project, index: true, foreign_key: { on_delete: :cascade }, null: false t.references :project, index: true, foreign_key: { on_delete: :cascade }, null: false
......
...@@ -7,19 +7,19 @@ class CreatePackagesPackageFiles < ActiveRecord::Migration ...@@ -7,19 +7,19 @@ class CreatePackagesPackageFiles < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def up def up
create_table :packages_package_files do |t| create_table :packages_package_files, id: :bigserial do |t|
t.timestamps_with_timezone null: false t.timestamps_with_timezone null: false
t.references :package, index: true, null: false
t.bigint :size
t.references :package, index: true, null: false
t.integer :file_type t.integer :file_type
t.integer :file_store t.integer :file_store
t.integer :size
t.binary :file_md5 t.binary :file_md5
t.binary :file_sha1 t.binary :file_sha1
t.string :file
t.string :file_name, null: false t.string :file_name, null: false
t.text :file, null: false
end end
add_concurrent_foreign_key :packages_package_files, :packages_packages, add_concurrent_foreign_key :packages_package_files, :packages_packages,
......
...@@ -7,14 +7,15 @@ class CreatePackagesMavenMetadata < ActiveRecord::Migration ...@@ -7,14 +7,15 @@ class CreatePackagesMavenMetadata < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def up def up
create_table :packages_maven_metadata do |t| create_table :packages_maven_metadata, id: :bigserial do |t|
t.timestamps_with_timezone null: false t.timestamps_with_timezone null: false
t.references :package, index: true, null: false t.references :package, index: true, null: false
t.string :path, null: false
t.string :app_group, null: false t.string :app_group, null: false
t.string :app_name, null: false t.string :app_name, null: false
t.string :app_version t.string :app_version
t.text :path, null: false
end end
add_concurrent_foreign_key :packages_maven_metadata, :packages_packages, add_concurrent_foreign_key :packages_maven_metadata, :packages_packages,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment