scheman 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -8
- data/lib/scheman/parsers/mysql.rb +4 -5
- data/lib/scheman/version.rb +1 -1
- data/spec/scheman/parsers/mysql_spec.rb +18 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0f5b2dcdccc0eb4557f8afddd786c3510a4c05d2
         | 
| 4 | 
            +
              data.tar.gz: 780b979f8c674c9234c59ee6df494875a206049a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9b00cc8f5fc5e3c3dd432c6ab5bd5550843a78bce588266a54af2097e2fb70cb0f295cd8c794fae09c2586a4ae1e683a77baeb59ea976145093a97fead9cf03e
         | 
| 7 | 
            +
              data.tar.gz: b4903ed2d840c631f1ad2eefbf89acae9ba4d3bcf961078ed45e81c0443134d27807e30ca09a3c2b6887e94e1ef0557368a1b82196f14a47d1ef716a1b1e2017
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,17 +1,20 @@ | |
| 1 | 
            +
            ## 0.0.6
         | 
| 2 | 
            +
            - Treat commented out line as space node (Thx @yuki-takeichi)
         | 
| 3 | 
            +
             | 
| 1 4 | 
             
            ## 0.0.5
         | 
| 2 | 
            -
             | 
| 5 | 
            +
            - Improve parser rule for CREATE TABLE (Thx @yuki-takeichi)
         | 
| 3 6 |  | 
| 4 7 | 
             
            ## 0.0.4
         | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 8 | 
            +
            - Add `schema diff` command
         | 
| 9 | 
            +
            - Improve MySQL parser logic
         | 
| 7 10 |  | 
| 8 11 | 
             
            ## 0.0.3
         | 
| 9 | 
            -
             | 
| 12 | 
            +
            - Support DEFAULT column qualifier
         | 
| 10 13 |  | 
| 11 14 | 
             
            ## 0.0.2
         | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            +
            - Support ADD INDEX
         | 
| 16 | 
            +
            - Support DROP INDEX
         | 
| 17 | 
            +
            - Detect altered column
         | 
| 15 18 |  | 
| 16 19 | 
             
            ## 0.0.1
         | 
| 17 | 
            -
             | 
| 20 | 
            +
            - 1st Release
         | 
| @@ -89,7 +89,7 @@ module Scheman | |
| 89 89 | 
             
                    end
         | 
| 90 90 |  | 
| 91 91 | 
             
                    rule(:space) do
         | 
| 92 | 
            -
                      match('\s')
         | 
| 92 | 
            +
                      match('\s') | comment
         | 
| 93 93 | 
             
                    end
         | 
| 94 94 |  | 
| 95 95 | 
             
                    rule(:space?) do
         | 
| @@ -222,7 +222,7 @@ module Scheman | |
| 222 222 | 
             
                    end
         | 
| 223 223 |  | 
| 224 224 | 
             
                    rule(:create_definition) do
         | 
| 225 | 
            -
                      index | field | 
| 225 | 
            +
                      index | field
         | 
| 226 226 | 
             
                    end
         | 
| 227 227 |  | 
| 228 228 | 
             
                    rule(:index) do
         | 
| @@ -297,12 +297,11 @@ module Scheman | |
| 297 297 |  | 
| 298 298 | 
             
                    rule(:field) do
         | 
| 299 299 | 
             
                      (
         | 
| 300 | 
            -
                         | 
| 300 | 
            +
                        field_name.as(:field_name) >> spaces >> field_type >>
         | 
| 301 301 | 
             
                          (spaces >> field_qualifiers).maybe.as(:field_qualifiers) >>
         | 
| 302 302 | 
             
                          (spaces >> field_comment).maybe >>
         | 
| 303 303 | 
             
                          (spaces >> reference_definition).maybe >>
         | 
| 304 | 
            -
                          (spaces >> on_update).maybe | 
| 305 | 
            -
                          comment.maybe
         | 
| 304 | 
            +
                          (spaces >> on_update).maybe
         | 
| 306 305 | 
             
                      ).as(:field)
         | 
| 307 306 | 
             
                    end
         | 
| 308 307 |  | 
    
        data/lib/scheman/version.rb
    CHANGED
    
    
| @@ -564,5 +564,23 @@ describe Scheman::Parsers::Mysql do | |
| 564 564 | 
             
                    expect { subject }.not_to raise_error
         | 
| 565 565 | 
             
                  end
         | 
| 566 566 | 
             
                end
         | 
| 567 | 
            +
             | 
| 568 | 
            +
                context "with various comment outs" do
         | 
| 569 | 
            +
                  let(:str) do
         | 
| 570 | 
            +
                    <<-EOS.strip_heredoc
         | 
| 571 | 
            +
                      # comment
         | 
| 572 | 
            +
                      CREATE TABLE `table1` (
         | 
| 573 | 
            +
                        `column1` INTEGER(11) NOT NULL AUTO_INCREMENT,
         | 
| 574 | 
            +
                        -- `column1` VARCHAR(11) NOT NULL AUTO_INCREMENT,
         | 
| 575 | 
            +
                        `column2` VARCHAR(255)/* comment here! */NOT NULL,
         | 
| 576 | 
            +
                        PRIMARY KEY (`column1`)
         | 
| 577 | 
            +
                      ); -- comment out
         | 
| 578 | 
            +
                    EOS
         | 
| 579 | 
            +
                  end
         | 
| 580 | 
            +
             | 
| 581 | 
            +
                  it "succeeds in parse" do
         | 
| 582 | 
            +
                    expect { subject }.not_to raise_error
         | 
| 583 | 
            +
                  end
         | 
| 584 | 
            +
                end
         | 
| 567 585 | 
             
              end
         | 
| 568 586 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: scheman
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ryo Nakamura
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015- | 
| 11 | 
            +
            date: 2015-03-31 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         |