The manual says:
Schema creation will fail if one or more tables already existed.
This method throws an
Wt::Dbo::Exception<http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1Dbo_1_1Exception.html>if
the table creation failed.
so:
try {
session_.createTables();
Wt::log("info") << "Database created";
} catch (Wt::Dbo::Exception &) {
Wt::log("info") << "Using existing database";
}
BR,
Wim.
2014-03-04 14:14 GMT+01:00 Tor Arne Fallingen <[email protected]>:
> It seems to me that in Wt MySQL backend if I call create table and the
> table already exist, the program crashes, and I can't really find any
> method to create table if it doesn't exist. So how do you usually solve
> this? I want to have the ability of creating the table automatically if it
> doesn't exist, it probably won't exist the first time the system is turned
> on, but then 99% of the rest of the time.
>
> Tor
>
>
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to
> Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries. Built-in WAN optimization and
> the
> freedom to use Git, Perforce or both. Make the move to Perforce.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest