Class: Doctrine

Inherits:
Object
  • Object
show all
Defined in:
lib/symfony/doctrine.rb

Class Method Summary collapse

Class Method Details

.clear_metadata_cacheObject



13
14
15
16
# File 'lib/symfony/doctrine.rb', line 13

def self.
    puts '---- Clearing Metadata Cache'
    fail 'Clearing metadata cache failed' unless system 'app/console doctrine:cache:clear-metadata'
end

.clear_query_cacheObject



18
19
20
21
# File 'lib/symfony/doctrine.rb', line 18

def self.clear_query_cache
    puts '---- Clearing Query Cache'
    fail 'Clearing query cache failed' unless system 'app/console doctrine:cache:clear-query'
end

.clear_result_cacheObject



23
24
25
26
# File 'lib/symfony/doctrine.rb', line 23

def self.clear_result_cache
    puts '---- Clearing Result Cache'
    fail 'Clearing result cache failed' unless system 'app/console doctrine:cache:clear-result'
end

.create_databaseObject



3
4
5
6
# File 'lib/symfony/doctrine.rb', line 3

def self.create_database
    puts '---- Creating Database'
    fail 'Database creation failed!' unless /(exists|Created)/.match(`app/console doctrine:database:create`)
end

.ensure_productionObject



28
29
30
31
# File 'lib/symfony/doctrine.rb', line 28

def self.ensure_production
    puts '---- Ensuring database has production settings'
    fail 'Database is not in production' unless system 'app/console doctrine:ensure-production-settings'
end

.run_migrationsObject



8
9
10
11
# File 'lib/symfony/doctrine.rb', line 8

def self.run_migrations
    puts '---- Running Migrations'
    fail 'Migrations failed!' unless system 'app/console doctrine:migrations:migrate -n'
end