Domain_Handler 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ef5722de03abdc5ddc6e446853611039a3197997bef6dcbb56ed6de5916c0ff
4
- data.tar.gz: 2f81c614a468eb6b595079f024c059cda7cf16510ee312ed3b9c4e71f84e7f22
3
+ metadata.gz: c3a325c9b481a241b98059ae96a2c98866324c5bc21b9adeaa6671655fdf62c4
4
+ data.tar.gz: b23defd160f265cd694192397a611f14390079d0b014f05517cd104258534b87
5
5
  SHA512:
6
- metadata.gz: 6426a8aec65577a077d3758292b81ff90c37007e423fede24c4ea351cfb1515702a066aa4fc0299cbf1427614114deba829c1dc5fea2311c9c3258a507680556
7
- data.tar.gz: 29f653070285d064e258dedf5c3a5ad0683fea8abec8d1b9e16c65005a67c1ef23dab639e155edaa3bd3431916fa21d0e14fafb85754a893f8134a90b76ecf60
6
+ metadata.gz: ac7e7c6cd501c22eb8029caa99b97b1420a3a5b93b2d066652c97e2b0947284801f6f4388d5fec1b9f6f322467ea07d1fb44a92819cc379ebf27ca00877f06e0
7
+ data.tar.gz: 03603d630db697b014175c8396158ffb4a19f2062799e7632bb4aa8cb155ff81b11a9b313fc425b5400f459d1af065a20638c364a123a934f686386bf9a40501
@@ -0,0 +1,17 @@
1
+ class CreateDomains < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :domains, id: false, primary_key: :domain_id do |t|
4
+ t.references :shop, foreign_key: true
5
+ t.string :host, null: false, default: ''
6
+ t.string :localization
7
+ t.string :market_web_presence
8
+ t.boolean :ssl_enabled, null: false
9
+ t.string :url
10
+ t.string :domain_id
11
+
12
+ # You probably would want `domain_id` to be unique. In that case...
13
+ t.index :domain_id, unique: true
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -1,12 +1,19 @@
1
- require 'rails/generators/active_record'
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
2
3
 
3
- module DomainHandler
4
+ module Domain_Handler
4
5
  module Generators
5
- class CreateDomainGenerator < ActiveRecord::Generators::Base
6
- source_root File.expand_path('../templates', __FILE__)
6
+ class MigrationGenerator < Rails::Generators::Base
7
+ include Rails::Generators::Migration
8
+
9
+ source_root File.expand_path('templates', __dir__)
7
10
 
8
11
  def create_migration_file
9
- migration_template 'create_domain.rb', 'db/migrate/create_domain.rb'
12
+ migration_template 'create_domain.rb', 'db/migrate/create_your_table.rb'
13
+ end
14
+
15
+ def self.next_migration_number(dirname)
16
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
10
17
  end
11
18
  end
12
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Domain_Handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arun Sahu
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - lib/domain_handler.rb
34
+ - lib/generators/doamin_handler/migration/tempates/create_domain.rb
34
35
  - lib/generators/doamin_handler/migration/tempates/create_domain_generator.rb
35
36
  homepage: https://rubygems.org/gems/hola
36
37
  licenses:
@@ -54,5 +55,5 @@ requirements: []
54
55
  rubygems_version: 3.3.7
55
56
  signing_key:
56
57
  specification_version: 4
57
- summary: Domain Dandler Gem
58
+ summary: Domain Handler Gem
58
59
  test_files: []