An unofficial, mostly Bitwarden-compatible API server written in Ruby (Sinatra and ActiveRecord)
1class CreateCiphers < ActiveRecord::Migration[5.1]
2 def change
3 create_table :ciphers, id: :string, primary_key: :uuid do |t|
4 t.string :user_uuid
5 t.string :folder_uuid
6 t.string :organization_uuid
7 t.integer :type
8 t.binary :data
9 t.boolean :favorite
10 t.binary :attachments
11 t.binary :name
12 t.binary :notes
13 t.binary :fields
14 t.binary :login
15 t.binary :card
16 t.binary :identity
17 t.binary :securenote
18 t.timestamps
19 end
20 add_foreign_key :ciphers, :users, { column: :user_uuid, primary_key: :uuid }
21 add_index(:ciphers, :user_uuid)
22 add_foreign_key :ciphers, :folders, { column: :folder_uuid, primary_key: :uuid }
23 add_index(:ciphers, :folder_uuid)
24
25 end
26end