문제

How to create table using ORM or Database builder with kohana 3.2? Is this possible at all? I saved the table definition (create sql) in a file. I'm sure the sql works because I used it in phpMyAdmin and it works. How can I execute the query?

도움이 되었습니까?

해결책

This should do the trick:

Database::instance()->query(NULL, 'raw query here');

Kohana's ORM does not have the capability to create tables for you. You can define the columns manually, but if I recall correctly not with enough information necessary to recreate the table.

I've seen two ORM's made for Kohana that could create tables. They were Sprig and Jelly if I remember correctly, I don't think they are maintained anymore though.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top