diff --git a/db/schema.rb b/db/schema.rb index 44ecd03..c3e4150 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -21,7 +21,7 @@ create_enum "rank_type", ["no rank", "superkingdom", "kingdom", "subkingdom", "superphylum", "phylum", "subphylum", "superclass", "class", "subclass", "superorder", "order", "suborder", "infraorder", "superfamily", "family", "subfamily", "tribe", "subtribe", "genus", "subgenus", "species group", "species subgroup", "species", "subspecies", "strain", "varietas", "forma"] create_table "dataset_items", id: :integer, unsigned: true, force: :cascade do |t| - t.bigint "dataset_id" + t.bigint "dataset_id", unsigned: true t.string "name", limit: 160 t.text "data", null: false t.integer "order" @@ -34,8 +34,8 @@ t.string "project_website", limit: 200 end - create_table "ec_cross_references", id: :bigint, force: :cascade do |t| - t.bigint "uniprot_entry_id", null: false + create_table "ec_cross_references", id: :bigint, unsigned: true, force: :cascade do |t| + t.bigint "uniprot_entry_id", null: false, unsigned: true t.string "ec_number_code", limit: 15, null: false t.index ["uniprot_entry_id"], name: "idx_ec_cross_references_uniprot_entry_id" end @@ -46,8 +46,8 @@ t.index ["code"], name: "idx_ec_numbers_code" end - create_table "go_cross_references", id: :bigint, force: :cascade do |t| - t.bigint "uniprot_entry_id", null: false + create_table "go_cross_references", id: :bigint, unsigned: true, force: :cascade do |t| + t.bigint "uniprot_entry_id", null: false, unsigned: true t.string "go_term_code", limit: 15, null: false t.index ["uniprot_entry_id"], name: "idx_go_cross_references_uniprot_entry_id" end @@ -59,8 +59,8 @@ t.index ["code"], name: "idx_go_terms_code" end - create_table "interpro_cross_references", id: :bigint, force: :cascade do |t| - t.bigint "uniprot_entry_id", null: false + create_table "interpro_cross_references", id: :bigint, unsigned: true, force: :cascade do |t| + t.bigint "uniprot_entry_id", null: false, unsigned: true t.string "interpro_entry_code", limit: 9, null: false t.index ["uniprot_entry_id"], name: "idx_interpro_cross_references_uniprot_entry_id" end @@ -72,50 +72,82 @@ end create_table "lineages", primary_key: "taxon_id", id: :integer, unsigned: true, force: :cascade do |t| - t.integer "superkingdom" - t.integer "kingdom" - t.integer "subkingdom" - t.integer "superphylum" - t.integer "phylum" - t.integer "subphylum" - t.integer "superclass" - t.integer "class" - t.integer "subclass" - t.integer "superorder" - t.integer "order" - t.integer "suborder" - t.integer "infraorder" - t.integer "superfamily" - t.integer "family" - t.integer "subfamily" - t.integer "tribe" - t.integer "subtribe" - t.integer "genus" - t.integer "subgenus" - t.integer "species_group" - t.integer "species_subgroup" - t.integer "species" - t.integer "subspecies" - t.integer "strain" - t.integer "varietas" - t.integer "forma" - end - - create_table "peptides", id: :bigint, force: :cascade do |t| - t.bigint "sequence_id", null: false - t.bigint "original_sequence_id", null: false - t.bigint "uniprot_entry_id", null: false + t.integer "superkingdom", limit: 3 + t.integer "kingdom", limit: 3 + t.integer "subkingdom", limit: 3 + t.integer "superphylum", limit: 3 + t.integer "phylum", limit: 3 + t.integer "subphylum", limit: 3 + t.integer "superclass", limit: 3 + t.integer "class", limit: 3 + t.integer "subclass", limit: 3 + t.integer "superorder", limit: 3 + t.integer "order", limit: 3 + t.integer "suborder", limit: 3 + t.integer "infraorder", limit: 3 + t.integer "superfamily", limit: 3 + t.integer "family", limit: 3 + t.integer "subfamily", limit: 3 + t.integer "tribe", limit: 3 + t.integer "subtribe", limit: 3 + t.integer "genus", limit: 3 + t.integer "subgenus", limit: 3 + t.integer "species_group", limit: 3 + t.integer "species_subgroup", limit: 3 + t.integer "species", limit: 3 + t.integer "subspecies", limit: 3 + t.integer "strain", limit: 3 + t.integer "varietas", limit: 3 + t.integer "forma", limit: 3 + end + + create_table "peptides", id: :bigint, unsigned: true, force: :cascade do |t| + t.bigint "sequence_id", null: false, unsigned: true + t.bigint "original_sequence_id", null: false, unsigned: true + t.bigint "uniprot_entry_id", null: false, unsigned: true t.index ["original_sequence_id"], name: "idx_peptides_original_sequence_id" t.index ["sequence_id"], name: "idx_peptides_sequence_id" t.index ["uniprot_entry_id"], name: "idx_peptides_uniprot_entry_id" end - create_table "sequences", id: :bigint, force: :cascade do |t| + create_table "posts", id: :integer, unsigned: true, force: :cascade do |t| + t.string "title", limit: 100, null: false + t.text "content", null: false + t.date "date", null: false + end + + create_table "proteome_caches", primary_key: "proteome_id", id: :integer, limit: 3, unsigned: true, default: nil, force: :cascade do |t| + t.text "json_sequences", limit: 16777215, null: false + end + + create_table "proteome_cross_references", id: :integer, unsigned: true, force: :cascade do |t| + t.integer "uniprot_entry_id", null: false, unsigned: true + t.integer "proteome_id", limit: 3, null: false, unsigned: true + end + + create_table "proteomes", id: :integer, limit: 3, unsigned: true, default: nil, force: :cascade do |t| + t.string "proteome_accession_number", limit: 12, null: false + t.string "proteome_name", limit: 145, null: false + t.integer "taxon_id", limit: 3, unsigned: true + t.binary "type_strain", limit: 1, default: 0b0, null: false + t.binary "reference_proteome", limit: 1, default: 0b0, null: false + t.string "strain", limit: 120 + t.string "assembly", limit: 45 + t.string "name", limit: 225 + end + + create_table "refseq_cross_references", id: :integer, unsigned: true, force: :cascade do |t| + t.integer "uniprot_entry_id", null: false, unsigned: true + t.string "protein_id", limit: 25 + t.string "sequence_id", limit: 25 + end + + create_table "sequences", id: :bigint, unsigned: true, force: :cascade do |t| t.string "sequence", limit: 50, null: false - t.integer "lca" - t.integer "lca_il" - t.binary "fa" - t.binary "fa_il" + t.integer "lca", unsigned: true + t.integer "lca_il", unsigned: true + t.binary "fa", limit: 16777215 + t.binary "fa_il", limit: 16777215 t.index ["lca"], name: "idx_sequences_lca" t.index ["lca_il"], name: "idx_sequences_lca_il" t.index ["sequence"], name: "idx_sequences_sequence" @@ -124,14 +156,14 @@ create_table "taxons", id: :integer, unsigned: true, force: :cascade do |t| t.string "name", limit: 120, null: false t.enum "rank", enum_type: "rank_type" - t.integer "parent_id" + t.integer "parent_id", limit: 3, unsigned: true t.integer "valid_taxon", limit: 2, default: 1, null: false end create_table "uniprot_entries", id: :integer, unsigned: true, force: :cascade do |t| t.string "uniprot_accession_number", limit: 10, null: false - t.integer "version", null: false - t.integer "taxon_id", null: false + t.integer "version", limit: 2, null: false, unsigned: true + t.integer "taxon_id", limit: 3, null: false, unsigned: true t.enum "type", null: false, enum_type: "db_type" t.string "name", limit: 150, null: false t.text "protein", null: false