mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 01:56:09 +00:00
[Ruby] Rename files/folders (#534)
* Rename templateDir: rails5 -> ruby-on-rails-server * Rename script: rails5-petstore-server.sh -> ruby-on-rails-server-petstore.sh * Rename sample folder: rails5 -> ruby-on-rails * Rename script(openapi3): rails5-petstore-server.sh -> ruby-on-rails-server-petstore.sh * Update ruby-on-rails-server-petstore.sh * Rename templateDir: sinatra -> ruby-sinatra-server * Rename script: sinatra-petstore-server.sh -> ruby-sinatra-server-petstore.sh * Rename sample folder: sinatra -> ruby-sinatra * Update script * Rename templateDir: ruby -> ruby-client * Rename script: ruby-petstore.sh -> ruby-client-petstore.sh * Update scripts * Update samples - bin/ruby-sinatra-server-petstore.sh - bin/ruby-on-rails-server-petstore.sh - bin/ruby-client-petstore.sh - bin/security/ruby-client-petstore.sh
This commit is contained in:
committed by
William Cheng
parent
6c14b4271f
commit
26e70fe642
@@ -0,0 +1,71 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
class InitTables < ActiveRecord::Migration
|
||||
def change
|
||||
create_table "api_response".pluralize.to_sym, id: false do |t|
|
||||
t.integer :code
|
||||
t.string :type
|
||||
t.string :message
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table "category".pluralize.to_sym, id: false do |t|
|
||||
t.integer :id
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table "order".pluralize.to_sym, id: false do |t|
|
||||
t.integer :id
|
||||
t.integer :pet_id
|
||||
t.integer :quantity
|
||||
t.datetime :ship_date
|
||||
t.string :status
|
||||
t.boolean :complete
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table "pet".pluralize.to_sym, id: false do |t|
|
||||
t.integer :id
|
||||
t.string :category
|
||||
t.string :name
|
||||
t.string :photo_urls
|
||||
t.string :tags
|
||||
t.string :status
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table "tag".pluralize.to_sym, id: false do |t|
|
||||
t.integer :id
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table "user".pluralize.to_sym, id: false do |t|
|
||||
t.integer :id
|
||||
t.string :username
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
t.string :email
|
||||
t.string :password
|
||||
t.string :phone
|
||||
t.integer :user_status
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
16
samples/server/petstore/ruby-on-rails/db/schema.rb
Normal file
16
samples/server/petstore/ruby-on-rails/db/schema.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# Note that this schema.rb definition is the authoritative source for your
|
||||
# database schema. If you need to create the application database on another
|
||||
# system, you should be using db:schema:load, not running all the migrations
|
||||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 0) do
|
||||
|
||||
end
|
||||
7
samples/server/petstore/ruby-on-rails/db/seeds.rb
Normal file
7
samples/server/petstore/ruby-on-rails/db/seeds.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file should contain all the record creation needed to seed the database with its default values.
|
||||
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
||||
# Character.create(name: 'Luke', movie: movies.first)
|
||||
Reference in New Issue
Block a user