X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fmigrations%2F003_rename_monitoring_param.py;fp=osm_mon%2Fmigrations%2F003_rename_monitoring_param.py;h=0000000000000000000000000000000000000000;hb=0085a4a8870a73a9186b0a2305ba00bae44a6ea0;hp=2d5108fc20282966a90003fda795c3af565b670c;hpb=d5ac6e1b2139145a4e051264d1566543a25c6d9d;p=osm%2FMON.git diff --git a/osm_mon/migrations/003_rename_monitoring_param.py b/osm_mon/migrations/003_rename_monitoring_param.py deleted file mode 100644 index 2d5108f..0000000 --- a/osm_mon/migrations/003_rename_monitoring_param.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright 2018 Whitestack, LLC -# ************************************************************* - -# This file is part of OSM Monitoring module -# All Rights Reserved to Whitestack, LLC - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# For those usages not covered by the Apache License, Version 2.0 please -# contact: bdiaz@whitestack.com or glavado@whitestack.com -## -"""Peewee migrations -- 003_rename_monitoring_param.py. - -Some examples (model - class or model name):: - - > Model = migrator.orm['model_name'] # Return model in current state by name - - > migrator.sql(sql) # Run custom SQL - > migrator.python(func, *args, **kwargs) # Run python code - > migrator.create_model(Model) # Create a model (could be used as decorator) - > migrator.remove_model(model, cascade=True) # Remove a model - > migrator.add_fields(model, **fields) # Add fields to a model - > migrator.change_fields(model, **fields) # Change fields - > migrator.remove_fields(model, *field_names, cascade=True) - > migrator.rename_field(model, old_field_name, new_field_name) - > migrator.rename_table(model, new_table_name) - > migrator.add_index(model, *col_names, unique=False) - > migrator.drop_index(model, *col_names) - > migrator.add_not_null(model, *field_names) - > migrator.drop_not_null(model, *field_names) - > migrator.add_default(model, field_name, default) - -""" - -import peewee as pw - -SQL = pw.SQL - - -def migrate(migrator, database, fake=False, **kwargs): - """Write your migrations here.""" - - migrator.rename_field('alarm', 'monitoring_param', 'metric') - - -def rollback(migrator, database, fake=False, **kwargs): - """Write your rollback migrations here.""" - - migrator.rename_field('alarm', 'metric', 'monitoring_param')