Class: DynamicMigrations::Postgres::Server::Database::Schema
- Defined in:
- lib/dynamic_migrations/postgres/server/database/schema.rb,
lib/dynamic_migrations/postgres/server/database/schema/enum.rb,
lib/dynamic_migrations/postgres/server/database/schema/enums.rb,
lib/dynamic_migrations/postgres/server/database/schema/table.rb,
lib/dynamic_migrations/postgres/server/database/schema/tables.rb,
lib/dynamic_migrations/postgres/server/database/schema/function.rb,
lib/dynamic_migrations/postgres/server/database/schema/functions.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/index.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/column.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/columns.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/indexes.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/trigger.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/triggers.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/validation.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/primary_key.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/validations.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/unique_constraint.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/unique_constraints.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraint.rb,
lib/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraints.rb
Overview
This class represents a postgres schema. A schema is essentially a namespace within a postgres database. Each schema is a collection of tables, functions and other database objects.
Defined Under Namespace
Modules: Enums, Functions, Tables Classes: Enum, ExpectedDatabaseError, Function, Table
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Source
Instance Method Summary collapse
-
#initialize(source, database, name) ⇒ Schema
constructor
initialize a new object to represent a postgres schema.
Methods included from Enums
#add_enum, #enum, #enums, #enums_hash, #has_enum?
Methods included from Functions
#add_function, #function, #functions, #functions_hash, #has_function?
Methods included from Tables
#add_table, #has_table?, #table, #tables, #tables_hash
Methods inherited from Source
#assert_is_a_symbol!, #from_configuration?, #from_database?
Constructor Details
#initialize(source, database, name) ⇒ Schema
initialize a new object to represent a postgres schema
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dynamic_migrations/postgres/server/database/schema.rb', line 22 def initialize source, database, name super source raise ExpectedDatabaseError, database unless database.is_a? Database raise ExpectedSymbolError, name unless name.is_a? Symbol @database = database @name = name @tables = {} @functions = {} @enums = {} end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
18 19 20 |
# File 'lib/dynamic_migrations/postgres/server/database/schema.rb', line 18 def database @database end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/dynamic_migrations/postgres/server/database/schema.rb', line 19 def name @name end |