Create table without specifying in db / migrate rails

I have the following structure for my article.rb model in rails

 property :artikelnummer, type: 'string', index: 'not_analyzed'
 property :eannummer, type: 'string', index: 'not_analyzed'

 property :bezeichnung, type: 'multi_field', fields: {
bezeichnung: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'},
suggest: {:type => 'string', :analyzer => 'suggest_analyzer'}
}

  property :bezeichnung_zusatz, type: 'multi_field', fields: {
bezeichnung_zusatz: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}
  }

  property :matchcode, type: 'string', index: 'not_analyzed'

  property :mengeneinheit, type: 'string', include_in_all: false

  property :gewicht, type: 'float', include_in_all: false

  property :hersteller, type: 'multi_field', fields: {
hersteller: {type: 'string'},
unchanged: {type: 'string', :index => 'not_analyzed'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}
  }

  property :hersteller_nummer, type: 'string', index: 'not_analyzed', include_in_all: false

  property :hersteller_artikelnummer, type: 'string', index: 'not_analyzed'

  property :gruppe, type: 'multi_field', fields: {
gruppe: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}
  }

  property :gruppe_zusatz, type: 'multi_field', fields: {
gruppe_zusatz: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}
  }

  property :gruppe_nummer, type: 'string', index: 'not_analyzed', include_in_all: false

 #property :hauptgruppe, type: 'multi_field', fields: {
 #  hauptgruppe: {type: 'string'},

# ngram: {: type => 'string' ,: index_analyzer => 'ngram_index_analyzer' ,: search_analyzer => 'ngram_search_analyzer'} #}

 # TODO: n-level facet
  property :hierarchie, type: 'multi_field', fields: {
hierarchie: {type: 'string', index_analyzer: 'hierarchie_index_analyzer', search_analyzer: 'keyword', include_in_all: false},
ngram: {type: 'string', index_analyzer: 'ngram_index_analyzer', search_analyzer: 'ngram_search_analyzer'}
   }

  property :langtext, type: 'multi_field', fields: {
langtext: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}
 }

  property :infotext, type: 'multi_field', fields: {
infotext: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}
 }

    property :bestelltext, type: 'multi_field', fields: {
bestelltext: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'}

}

    property :dimension, type: 'string', include_in_all: false

    property :listenpreis_netto, type: 'float', index: 'not_analyzed', include_in_all: false

   property :listenpreis_brutto, type: 'float', index: 'not_analyzed', include_in_all: false

is there any way to create a table based on the above information migration file does not exist in db / migrations .. if so, how can this be done

early

change the easiest way i can ask

I want to get the information above in my database, how can I do this

+4
source share
1 answer

Mongo ActiveRecord. (Mongoid?); Mongo, Ruby. ( /); mongo spring, . , . , ?

0

Source: https://habr.com/ru/post/1526738/


All Articles