Exemplo n.º 1
0
        void before_each()
        {
            schema = new Schema(new Seed());

            schema.Seed.PurgeDb();

            schema.Scripts().ForEach(s => schema.Seed.ExecuteNonQuery(s()));

            MvcApplication.Mixins();
        }
Exemplo n.º 2
0
        public void ResetDbs()
        {
            var schema = new Schema(testDb);

            schema.Seed.PurgeDb();

            schema.Scripts().ForEach<dynamic>(s => schema.Seed.ExecuteNonQuery(s()));

            schema = new Schema(webDb);

            schema.Seed.PurgeDb();

            schema.Scripts().ForEach<dynamic>(s => schema.Seed.ExecuteNonQuery(s()));
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            if (args.Length == 0) throw new InvalidOperationException("first argument should be a connection string.");

            Console.WriteLine("Purging and regenerating schema for " + args[0] + ".");

            var connection = new ConnectionProfile { ConnectionString = args[0] };

            var seed = new Seed(connection);

            var schema = new Schema(seed);

            seed.PurgeDb();

            seed.ExecuteTo(schema.Scripts(), schema.Current());

            Console.WriteLine("Done.");
        }