-- how to add a field
if not exists( select * from #fields where table_name = '$TableName' and Field_Name='neuerShopArtikel'  )
    then ALTER TABLE $TableName ADD COLUMN neuerShopArtikel BOOLEAN DEFAULT FALSE DESCRIPTION 'neuer Shopartikel';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='Lagerplatz'  )
    then ALTER TABLE $TableName ADD COLUMN Lagerplatz SHORTSTRING(10) DEFAULT '' DESCRIPTION 'Lagerplatz';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='Teepflanzenvarietaet2'  )
    then ALTER TABLE $TableName ADD COLUMN Teepflanzenvarietaet2 SHORTSTRING(80) DEFAULT '' DESCRIPTION 'Teepflanzenvarietät 2';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='Land'  )
    then ALTER TABLE $TableName ADD COLUMN Land SHORTSTRING(80) DEFAULT '' DESCRIPTION 'Land';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='Provinz'  )
    then ALTER TABLE $TableName ADD COLUMN Provinz SHORTSTRING(80) DEFAULT '' DESCRIPTION 'Provinz';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='Ort'  )
    then ALTER TABLE $TableName ADD COLUMN Ort SHORTSTRING(80) DEFAULT '' DESCRIPTION 'Ort';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='ShopUpdate'  )
    then ALTER TABLE $TableName ADD COLUMN ShopUpdate BOOLEAN DEFAULT FALSE DESCRIPTION 'Shop Update Flag';
end if;

if not exists( select * from #fields where table_name = '$TableName' and Field_Name='Zubereitung'  )
   then ALTER TABLE $TableName ADD COLUMN "Zubereitung" CLOB DESCRIPTION 'Zubereitungs Reihenfolge';
end if;

-- how to drop a field
--if exists( select * from #fields where table_name = '$TableName' and Field_Name='neuerShopArtikel'  )
--   then ALTER TABLE $TableName DROP COLUMN neuerShopArtikel ;
--end if;

