示例#1
0
        public void Execute(MySqlConnection connection, MySqlTransaction transaction)
        {
            List <VersionPoint> versions = new List <VersionPoint>();

            SelectBuilder builder = new SelectBuilder();

            builder.Table = "schema_version";
            using (MySqlCommand command = new MySqlCommand(builder.ToString(), connection, transaction))
            {
                using (MySqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        uint version  = (uint)reader["version"];
                        bool breaking = false;
                        if (reader.ColumnExists("breaking"))
                        {
                            breaking = (bool)reader["breaking"];
                        }
                        versions.Add(new VersionPoint(version, breaking));
                    }
                }
            }
            versions.Sort((x, y) => x.Version.CompareTo(y.Version));
            mResult = DoVerify(versions);
        }