Legacy Database how to

I’ve a legacy db that I want to run with web2py what should I do ?

  • you must create an auto increment integer field called “id” and make it a PRIMARY KEY.
    This has to be done for every table in your database
  • Then you’ve to take care of references [change them according to the changes you’ve made to the auto increment field which is now called ‘id’]
  • you still need to define it in your model since web2py does not query a db for schemas.
  • 
    db.define_table('legacy_db',
       Field(....),
       Field(....),
       Field(....),
       migrate=False) 
    # migrate=False is a MUST to add not (optional) in case of using a legacy database
    
    Advertisements

    15 Responses to Legacy Database how to

    1. Hello, Neat post. There is a problem along with your website in web explorer, might check this?

      IE still is the marketplace leader and a huge component
      of people will miss your magnificent writing because of this problem.

    2. Hello there, There’s no doubt that your blog may be having internet browser compatibility issues. Whenever I take a look at your site in Safari, it looks fine however, when opening in I.E., it has some overlapping issues. I merely wanted to provide you with a quick heads up! Aside from that, great site!

    3. If some one needs expert view regarding blogging and site-building afterward i advise him/her to pay a visit
      this weblog, Keep up the fastidious work.

    4. [主页] says:

      I’ll right away grasp your rss feed as I can’t to find your e-mail subscription
      hyperlink or newsletter service. Do you’ve any? Please permit me recognise so that I could subscribe. Thanks.

    5. Jigsy.Com says:

      verhuizen maastricht

    6. Excellent way of explaining, and nice article to obtain information regarding my
      presentation focus, which i am going to present in college.

    7. Xanax says:

      The post offers confirmed beneficial to me. It’s very useful and you’re naturally very knowledgeable of this type. You have got opened our sight to be able to different opinion of this specific topic using interesting and sound written content.

    8. I think everything wrote made a ton of sense. But, consider
      this, what if you were to create a awesome headline? I ain’t suggesting your content isn’t solid, but suppose you added something that grabbed a person’s attention? I mean Legacy Database how to | Web2py’s Blog is kinda boring.
      You should glance at Yahoo’s home page and note how they create news titles to grab people interested. You might add a related video or a related pic or two to get people interested about everything’ve written.
      In my opinion, it would bring your posts a little livelier.

    9. Hello to all, how is everything, I think every one is getting more from this
      web page, and your views are fastidious designed for new
      people.

    10. Xanax says:

      Your write-up provides proven necessary to us.
      It’s very helpful and you’re obviously quite educated in this area. You have got popped our eyes in order to varying thoughts about this specific matter along with intriquing, notable and strong content.

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    %d bloggers like this: