Esempio n. 1
0
 /// <summary>
 /// Drops the entire schema.
 /// </summary>
 /// <param name="connection"></param>
 public static void Drop(NpgsqlConnection connection)
 {
     if (PostgreSQLSchemaTools.DetectRelationMembersTable(connection))
     {
         PostgreSQLSchemaTools.DropRelationMembersTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectRelationTagsTable(connection))
     {
         PostgreSQLSchemaTools.DropRelationTagsTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectRelationTable(connection))
     {
         PostgreSQLSchemaTools.DropRelationTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectWayNodesTable(connection))
     {
         PostgreSQLSchemaTools.DropWayNodesTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectWayTagsTable(connection))
     {
         PostgreSQLSchemaTools.DropWayTagsTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectWayTable(connection))
     {
         PostgreSQLSchemaTools.DropWayTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectNodeTagsTable(connection))
     {
         PostgreSQLSchemaTools.DropNodeTagsTable(connection);
     }
     if (PostgreSQLSchemaTools.DetectNodeTable(connection))
     {
         PostgreSQLSchemaTools.DropNodeTable(connection);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates the entire schema but also detects existing tables.
        /// </summary>
        /// <param name="connection"></param>
        public static void CreateAndDetect(NpgsqlConnection connection)
        {
            if (!PostgreSQLSchemaTools.DetectNodeTable(connection))
            {
                PostgreSQLSchemaTools.CreateNodeTable(connection);
            }
            if (!PostgreSQLSchemaTools.DetectNodeTagsTable(connection))
            {
                PostgreSQLSchemaTools.CreateNodeTagsTable(connection);
            }

            if (!PostgreSQLSchemaTools.DetectWayTable(connection))
            {
                PostgreSQLSchemaTools.CreateWayTable(connection);
            }
            if (!PostgreSQLSchemaTools.DetectWayTagsTable(connection))
            {
                PostgreSQLSchemaTools.CreateWayTagsTable(connection);
            }
            if (!PostgreSQLSchemaTools.DetectWayNodesTable(connection))
            {
                PostgreSQLSchemaTools.CreateWayNodesTable(connection);
            }

            if (!PostgreSQLSchemaTools.DetectRelationTable(connection))
            {
                PostgreSQLSchemaTools.CreateRelationTable(connection);
            }
            if (!PostgreSQLSchemaTools.DetectRelationTagsTable(connection))
            {
                PostgreSQLSchemaTools.CreateRelationTagsTable(connection);
            }
            if (!PostgreSQLSchemaTools.DetectRelationMembersTable(connection))
            {
                PostgreSQLSchemaTools.CreateRelationMembersTable(connection);
            }
        }