# Path: tethysapp/erfp_tool/model.py
# class MainSettings(Base):
# class BaseLayer(Base):
# class DataStore(Base):
# class DataStoreType(Base):
# class Geoserver(Base):
# class Watershed(Base):
# class WatershedWatershedGroupLink(Base):
# class WatershedGroup(Base):
#     def __init__(self, base_layer_id, ecmwf_rapid_prediction_directory, default_group_id,
#                  era_interim_rapid_directory, wrf_hydro_rapid_prediction_directory):
#     def __init__(self, name, api_key):
#     def __init__(self, server_name, data_store_type_id, api_endpoint, api_key):
#     def __init__(self, code_name, human_readable_name):
#     def __init__(self, name, url, username, password):
#     def __init__(self, watershed_name, subbasin_name, folder_name, file_name,
#                  data_store_id, ecmwf_rapid_input_resource_id, 
#                  ecmwf_data_store_watershed_name, ecmwf_data_store_subbasin_name,
#                  wrf_hydro_data_store_watershed_name, wrf_hydro_data_store_subbasin_name,
#                  geoserver_id, geoserver_drainage_line_layer, geoserver_catchment_layer, 
#                  geoserver_gage_layer, geoserver_ahps_station_layer, geoserver_outline_layer,
#                  geoserver_drainage_line_uploaded, geoserver_catchment_uploaded, 
#                  geoserver_gage_uploaded, geoserver_ahps_station_uploaded, geoserver_outline_uploaded,
#                  kml_drainage_line_layer, kml_catchment_layer, kml_gage_layer):
#     def __init__(self, name):


from .model import (Base, BaseLayer, DataStore, DataStoreType, Geoserver, MainSettings,
                    settingsEngine, SettingsSessionMaker)
# Put your persistent store initializer functions in here

def init_erfp_settings_db(first_time):
    # Create tables
    Base.metadata.create_all(settingsEngine)
    
    # Initial data
    if first_time:
        #make session
        session = SettingsSessionMaker()
        
        #add all possible base layers
        session.add(BaseLayer("MapQuest","none",))

# Path: tethysapp/erfp_tool/model.py
# class MainSettings(Base):
# class BaseLayer(Base):
# class DataStore(Base):
# class DataStoreType(Base):
# class Geoserver(Base):
# class Watershed(Base):
# class WatershedWatershedGroupLink(Base):
# class WatershedGroup(Base):
#     def __init__(self, base_layer_id, ecmwf_rapid_prediction_directory, default_group_id,
#                  era_interim_rapid_directory, wrf_hydro_rapid_prediction_directory):
#     def __init__(self, name, api_key):
#     def __init__(self, server_name, data_store_type_id, api_endpoint, api_key):
#     def __init__(self, code_name, human_readable_name):
#     def __init__(self, name, url, username, password):
#     def __init__(self, watershed_name, subbasin_name, folder_name, file_name,
#                  data_store_id, ecmwf_rapid_input_resource_id, 
#                  ecmwf_data_store_watershed_name, ecmwf_data_store_subbasin_name,
#                  wrf_hydro_data_store_watershed_name, wrf_hydro_data_store_subbasin_name,
#                  geoserver_id, geoserver_drainage_line_layer, geoserver_catchment_layer, 
#                  geoserver_gage_layer, geoserver_ahps_station_layer, geoserver_outline_layer,
#                  geoserver_drainage_line_uploaded, geoserver_catchment_uploaded, 
#                  geoserver_gage_uploaded, geoserver_ahps_station_uploaded, geoserver_outline_uploaded,
#                  kml_drainage_line_layer, kml_catchment_layer, kml_gage_layer):
#     def __init__(self, name):


# Path: tethysapp/erfp_tool/init_stores.py
from .model import (Base, BaseLayer, DataStore, DataStoreType, Geoserver, MainSettings,
                    settingsEngine, SettingsSessionMaker)

# Put your persistent store initializer functions in here

def init_erfp_settings_db(first_time):
    # Create tables
    Base.metadata.create_all(settingsEngine)
    
    # Initial data
    if first_time:
        #make session
        session = SettingsSessionMaker()
        
        #add all possible base layers
        session.add(BaseLayer("MapQuest","none",))

        session.add(BaseLayer("Esri","none",))