Module: ActualDbSchema
- Defined in:
- lib/actual_db_schema.rb,
lib/actual_db_schema/git.rb,
lib/actual_db_schema/store.rb,
lib/actual_db_schema/engine.rb,
lib/actual_db_schema/version.rb,
lib/actual_db_schema/git_hooks.rb,
lib/actual_db_schema/migration.rb,
lib/actual_db_schema/multi_tenant.rb,
lib/actual_db_schema/commands/base.rb,
lib/actual_db_schema/commands/list.rb,
lib/actual_db_schema/configuration.rb,
lib/actual_db_schema/failed_migration.rb,
lib/actual_db_schema/output_formatter.rb,
lib/actual_db_schema/patches/migrator.rb,
lib/actual_db_schema/commands/rollback.rb,
lib/actual_db_schema/migration_context.rb,
lib/actual_db_schema/patches/migration_proxy.rb,
lib/actual_db_schema/patches/migration_context.rb,
app/controllers/actual_db_schema/migrations_controller.rb,
app/controllers/actual_db_schema/phantom_migrations_controller.rb
Overview
The main module definition
Defined Under Namespace
Modules: Commands, MultiTenant, OutputFormatter, Patches
Classes: Configuration, Engine, FailedMigration, Git, GitHooks, Migration, MigrationContext, MigrationsController, PhantomMigrationsController, Store
Constant Summary
collapse
- VERSION =
"0.8.1"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
29
30
31
|
# File 'lib/actual_db_schema.rb', line 29
def config
@config
end
|
.failed ⇒ Object
Returns the value of attribute failed.
29
30
31
|
# File 'lib/actual_db_schema.rb', line 29
def failed
@failed
end
|
Class Method Details
35
36
37
|
# File 'lib/actual_db_schema.rb', line 35
def self.configure
yield(config)
end
|
.db_config ⇒ Object
68
69
70
71
72
73
74
|
# File 'lib/actual_db_schema.rb', line 68
def self.db_config
if ActiveRecord::Base.respond_to?(:connection_db_config)
ActiveRecord::Base.connection_db_config.configuration_hash
else
ActiveRecord::Base.connection_config
end
end
|
.default_migrated_folder ⇒ Object
56
57
58
|
# File 'lib/actual_db_schema.rb', line 56
def self.default_migrated_folder
Rails.root.join("tmp", "migrated")
end
|
.migrated_folder ⇒ Object
39
40
41
|
# File 'lib/actual_db_schema.rb', line 39
def self.migrated_folder
migrated_folders.first
end
|
.migrated_folders ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/actual_db_schema.rb', line 43
def self.migrated_folders
return [default_migrated_folder] unless migrations_paths
Array(migrations_paths).map do |path|
if path.end_with?("db/migrate")
default_migrated_folder
else
postfix = path.split("/").last
Rails.root.join("tmp", "migrated_#{postfix}")
end
end
end
|
.migration_filename(fullpath) ⇒ Object
76
77
78
|
# File 'lib/actual_db_schema.rb', line 76
def self.migration_filename(fullpath)
fullpath.split("/").last
end
|
.migrations_paths ⇒ Object
60
61
62
63
64
65
66
|
# File 'lib/actual_db_schema.rb', line 60
def self.migrations_paths
if ActiveRecord::Base.respond_to?(:connection_db_config)
ActiveRecord::Base.connection_db_config.migrations_paths
else
ActiveRecord::Base.connection_config[:migrations_paths]
end
end
|