Beispiel #1
0
		private void AddForeignKey(DataRow rs, ISchemaReader meta)
		{
			String fk = (string)rs["CONSTRAINT_NAME"];

			if (fk == null) return;

			ForeignKeyMetadata info = GetForeignKeyMetadata(fk);
			if (info == null)
			{
				info = new ForeignKeyMetadata(rs);
				foreignKeys.Add(info.getName().ToLower(), info);
			}

			foreach (DataRow row in meta.GetIndexColumns(schema, name, fk).Rows)
			{
				info.AddColumn(GetColumnMetadata((string)row["COLUMN_NAME"]));
			}
		}
Beispiel #2
0
		private void AddIndex(DataRow rs, ISchemaReader meta)
		{
			String index = (string)rs["INDEX_NAME"];

			if (index == null) return;

			IndexMetadata info = GetIndexMetadata(index);
			if (info == null)
			{
				info = new IndexMetadata(rs);
				indexes.Add(info.getName().ToLower(), info);
			}

			foreach (DataRow row in meta.GetIndexColumns(schema, name, index).Rows)
			{
				info.AddColumn(GetColumnMetadata((string)row["COLUMN_NAME"]));
			}
		}