def run_migrations(self, schema_name, included_apps, options): self._notice("=== Running migrate for schema %s" % schema_name) connection.set_schema(schema_name) command = MigrateCommand() command.execute(*self.args, **options) connection.set_schema_to_public()
def run_migrations(self, schema_name, included_apps): if int(self.options.get('verbosity', 1)) >= 1: self._notice("=== Running migrate for schema %s" % schema_name) connection.set_schema(schema_name) command = MigrateCommand() command.execute(*self.args, **self.options) connection.set_schema_to_public()
def run_migrations(self, schema_name, included_apps): if int(self.options.get('verbosity', 1)) >= 1: self._notice("=== Running migrate for schema %s" % schema_name) if not schema_exists(schema_name): raise MigrationSchemaMissing( 'Schema "{}" does not exist'.format(schema_name)) connection.set_schema(schema_name) command = MigrateCommand() command.execute(*self.args, **self.options) connection.set_schema_to_public()
def run_migrations(self, schema_name, included_apps): if int(self.options.get('verbosity', 1)) >= 1: self._notice("=== Running migrate for schema %s" % schema_name) if not schema_exists(schema_name): raise MigrationSchemaMissing('Schema "{}" does not exist'.format( schema_name)) connection.set_schema(schema_name) command = MigrateCommand() command.execute(*self.args, **self.options) connection.set_schema_to_public()
def run_migrations(self, schema_name, included_apps): self._notice("=== Running migrate for schema %s" % schema_name) connection.set_schema(schema_name) command = MigrateCommand() defaults = {} for opt in MigrateCommand.option_list: if opt.dest in self.options: defaults[opt.dest] = self.options[opt.dest] elif opt.default is NO_DEFAULT: defaults[opt.dest] = None else: defaults[opt.dest] = opt.default command.execute(*self.args, **defaults) connection.set_schema_to_public()
def run_migrations(self, schema_name, included_apps): self._notice("=== Running migrate for schema %s" % schema_name) connection.set_schema(schema_name, include_public=False) apps.app_configs = OrderedDict() apps.clear_cache() apps.set_installed_apps(included_apps) command = MigrateCommand() defaults = {} for opt in MigrateCommand.option_list: if opt.dest in self.options: defaults[opt.dest] = self.options[opt.dest] elif opt.default is NO_DEFAULT: defaults[opt.dest] = None else: defaults[opt.dest] = opt.default command.execute(*self.args, **defaults) connection.set_schema('public', include_public=True) apps.app_configs = OrderedDict() apps.clear_cache() apps.set_installed_apps(settings.SHARED_APPS)
def migrate(params=None): command = MigrateCommand() parser = command.create_parser('manage.py', 'migrate') options = parser.parse_args(params or []) cmd_options = vars(options) return command.execute(**cmd_options)