#NEWLINE# def test_inherit_drop_parent_column( self ) : #NEWLINE# #INDENT# 'Drop a column from a parent table, child should not drop as well' #NEWLINE# stmts = [ CREATE_STMT1 , 'CREATE TABLE t2 (c3 date) INHERITS (t1)' ] #NEWLINE# inmap = self . std_map ( ) #NEWLINE# inmap [ 'schema public' ] . update ( { #NEWLINE# #INDENT# 'table t1' : { #NEWLINE# #INDENT# 'columns' : [ { #NEWLINE# #INDENT# 'c1' : { #NEWLINE# #INDENT# 'type' : 'integer' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# inmap [ 'schema public' ] . update ( { #NEWLINE# #INDENT# 'table t2' : { #NEWLINE# #INDENT# 'columns' : [ { #NEWLINE# #INDENT# 'c1' : { #NEWLINE# #INDENT# 'type' : 'integer' , #NEWLINE# 'inherited' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'c3' : { #NEWLINE# #INDENT# 'type' : 'date' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'inherits' : [ 't1' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# sql = self . to_sql ( inmap , sql ) #NEWLINE# assert ( len ( sql ) == 1 ) #NEWLINE# assert ( fix_indent ( sql [ 0 ] ) == 'ALTER TABLE t1 DROP COLUMN c2' )