Commit 58eee015 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Generate models necessary for maven repository backend

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 6e27e28e
module Packages
def self.table_name_prefix
'packages_'
end
end
class Packages::MavenMetadatum < ActiveRecord::Base
belongs_to :package
end
class Packages::Package < ActiveRecord::Base
belongs_to :project
end
class Packages::PackageFile < ActiveRecord::Base
belongs_to :package
end
class CreatePackagesPackageFiles < ActiveRecord::Migration
DOWNTIME = false
def change
create_table :packages_package_files do |t|
t.references :package, index: true, foreign_key: true, null: false
t.string :file
t.integer :file_type
t.integer :size
t.binary :file_md5
t.binary :file_sha1
t.timestamps null: false
end
end
end
class CreatePackagesPackages < ActiveRecord::Migration
def change
create_table :packages_packages do |t|
t.references :project, index: true, foreign_key: true, null: false
t.string :name
t.string :version
t.timestamps null: false
end
end
end
class CreatePackagesMavenMetadata < ActiveRecord::Migration
def change
create_table :packages_maven_metadata do |t|
t.references :package, index: true, foreign_key: true, null: false
t.string :app_group, null: false
t.string :app_name, null: false
t.string :app_version, null: false
t.timestamps null: false
end
end
end
require 'rails_helper'
RSpec.describe Packages::MavenMetadatum, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
require 'rails_helper'
RSpec.describe Packages::PackageFile, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
require 'rails_helper'
RSpec.describe Packages::Package, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
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