Regeneration of database in yii - yii

I am a newbie to yii. I have lost my database, I only have models, controllers and views. Can I systematically regenerate database using models, please?

Related

jhipster entity - what exactly is that?

I am wondering what jhipster entities are exactly?
What if I just want to create a new page/view without any database entry and relationship? For example: the about page, do I have to use the entity generator in order to create it? What are the benefits of it?
jhipster entity tutorial
Regards
redyar
Entities are typically objects that are backed by a database table. With JHipster, you can generate entities (and their associated screens) using Yeoman.
For an about page, or any other page, you can author them by hand. You don't need to use a generator. JHipster merely provides its entity sub-generator as a convenience for you.
You can also use the Yeoman generator for AngularJS to generate basic scaffolding.
http://yeoman.io
Immagine to build a website of e-commerce. That website contains users, sensible data informations, details about sellers and other things. You can save a lot of time creating it with Jhipster because it automatically create Objects class that represents database's tables, RESTful web services to manage them and the frontend view with Angular, CSS and HTML (all generated automatically). The objects that represent database's tables are entities.
With entities you can do CRUD queries on database using Java objects and Java methods with Spring framework. You can do queries by calling java methods. Thats all! After some practice it's really easy to use.
With that generator you don't have to configure relationships, constraints or things like that. Jhipster does that for you!
If you need a web application that does not use a database you don't need to use a generator like this, in my opinion.
I took the right Matt Raible's answer trying to give you more informations about entities. I hope to be helpful!
Have a nice day!

create databases and tables dynamically with Yii framework possible?

I am developing a system with a master database and multiple databases, once for each client. The client database and its tables will be created when the client fills in and submit a form with all the required details.
My question: does the Yii framework support the dynamic creation of databases and tables? If so, is there any example code? (I'm still learning about Yii) I couldnt find an answer on the Yii website (documentation and forum) nor on this site. (I did notice that dynamic databse connections are possibble with Yii - Yii Dynamic DB Connection according to user?)
For connections in runtime read php-yii-database-connect-in-runtime and after that, Yii have all Building Schema Manipulation Queries like CREATE, ALTER, DROP etc.
So easy and simple.
building-schema-manipulation-queries

Apply simplemembership to my database-first application

Hi I already read many articles about simple membership but I'm still confused about the concept. I'd like to apply simplemembership to my existing database UserProfile table. I have MVC4 Internet application. So I decided to modify (WebSecurity.InitializeDatabaseConnection). As I understand, It create a table if there is no co-responding table in the database. But I'm wondering what is up about AccountModels.cs class if I already have UserProfile in my edmx? AccountModels.cs already have several kinds of model class related to simplemembership. What is happening to this classes if I hook up UserProfile from database?

How to manage concurrency while updating Oracle View through EF in an MVC project?

My MVC 4 application is using Entity Framework 5 as its ORM.
And an Oracle 10 database is used as its back-end.
MVC Views are displaying data from Oracle DB Views, and I have no control over database schema.
The Views are updatable, and there is also a requirement of managing concurrency. There is no timestamp sort of column in the underlying table/ view.
In such scenario, how can I manage concurrency?
Any advice on this will be much appreciated.
Sorry for the late answer but I just came across this.
As you have no access to the database, it would not be easy at all to prevent 2 users from requesting edit on the same record (even if you did, I am not sure there is a bullet proof way of doing this in a web application). What you can do is prevent a user from editing an object that was modified between the time it was retrieved and the time of change submission. I am going to assume that in your MVC application you are using view models to represent the domain model objects on the screen. You can include as an additional field in the view model a field for a hash computed based on the state of the object at time of retrieval. When an edit is posted, you would need to retrieve the record again from the database, compare its current hash with the one submitted by the MVC view. In case of discrepancy, inform the user of change and show the values as they are now in the database informing the user of what happened (e.g. by adding a model state error).

Orchard CMS, how to Query the Orchard Database?

I need to Query existing Tables inside my Orchard database. These tables are coming from an existing ecommerce website. So my question is: How do I query tables that contain data inside my Orchard database and have the data displayed on the Admin/Editor side. And finally on the front end/user side when the page is published? I have All the Models, Drivers, Handlers and Views created. I'm just stumped on where to Query the DB.
You can inject an IRepository and do queries on its Table. If that is still too high level, you can inject an ISessionLocator and call For on it. The session object it will give you is the nHibernate session, on which you can perform arbitrary queries.