Sha256: 07a56106b35f4032cd66793d6c3a18c608cb3016d26f4faed649e1b0c4a66c34

Contents?: true

Size: 496 Bytes

Versions: 4

Compression:

Stored size: 496 Bytes

Contents

# encoding: UTF-8

module Spontaneous::Cli
  class Init
    class MySQL < Db

      def create_database_commands(config)
        host = config[:host].blank? ? "" : "@#{config[:host]}"
        cmds = [ ["CREATE DATABASE `#{config[:database]}` CHARACTER SET UTF8", true] ]
        unless config[:user] == "root"
          cmds << ["GRANT ALL ON `#{config[:database]}`.* TO `#{config[:user]}`#{host} IDENTIFIED BY '#{config[:password]}'", false]
        end
        cmds
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta9 lib/spontaneous/cli/init/mysql.rb
spontaneous-0.2.0.beta8 lib/spontaneous/cli/init/mysql.rb
spontaneous-0.2.0.beta7 lib/spontaneous/cli/init/mysql.rb
spontaneous-0.2.0.beta6 lib/spontaneous/cli/init/mysql.rb