public static MigrationMetadata GetMetadataForMigration(Type type)
        {
            var migrationAttribute = type.GetOneAttribute<MigrationAttribute>();
            var metadata = new MigrationMetadata { Type = type, Version = migrationAttribute.Version };

            foreach (MigrationTraitAttribute traitAttribute in type.GetAllAttributes<MigrationTraitAttribute>())
                metadata.AddTrait(traitAttribute.Name, traitAttribute.Value);

            return metadata;
        }
        public static MigrationMetadata GetMetadataForMigration(Type type)
        {
            var migrationAttribute = type.GetOneAttribute <MigrationAttribute>();
            var metadata           = new MigrationMetadata {
                Type = type, Version = migrationAttribute.Version, Group = migrationAttribute.Group
            };

            foreach (MigrationTraitAttribute traitAttribute in type.GetAllAttributes <MigrationTraitAttribute>())
            {
                metadata.AddTrait(traitAttribute.Name, traitAttribute.Value);
            }

            return(metadata);
        }