Prefix the default table names for all liferay tables - liferay

Can I prefix all the Liferay tables that it initially creates by doing some configuration changes.
I am new to Liferay and analyzing it for my use.
I gather that new tables being created are prefixed to avoid any conflicts but I have a situation where it suits me better if its other way round.

The answer is no for tables that Liferay creates on its first start. And as you have found yes for newly created tables using servicebuilder(uses the namespace tag)

Related

How to create tables in Hybris without init?

Some time ago two new types were created without deployment tables and their items were stored in ComposedType's table. After a while, this problem was noticed and deployment tables were added to *-items.xml but these two tables aren't created during update. How can I handle this problem? Unfortunately, I can't use init on our environments.
You need to define two new itemtypes with the desired deployment table in the items.xml and perform system update. Then, you need to import the data from the two old itemtypes to the new itemtypes. Finally, you need to delete the old columns using SQL command and clear the orphaned types from hAC.

Cassandra create and load data atomicity

I have got a web service which is looking for the last create table
[name_YYYYMMddHHmmss]
I have a persister job that creates and loads a table (insert or bulk)
Is there something that hides a table until it is fully loaded ?
First, I have created a technical table, it works but I will need one by keyspace (using cassandraAuth). I don’t like this.
I was thinking about tags, but it doesn’t seem to exist.
- create a table with tag and modify or remove it when the table is loaded.
There is also the table comment option.
Any ideas?
Table comment is a good option. We use it for some service information about the table, e.g. table versions tracking.

Dynamic Data List: Configuring custom datasource for Select Data Definition

It is possible to specify or configure a custom datasource to load the select-options for a particular Data definition for Dynamic Data list?
The following image might clarify what I need to do:
Will it be possible that when the Dynamic Data form is shown to the User the values come from any of the liferay tables like User_, Group_ etc or from any custom plugin portlet's DB table etc.
Thanks
P.S.: Also posted on liferay forum: https://www.liferay.com/community/forums/-/message_boards/message/50483965

What is the best way to add tables to Entity Framework 6 Code First to Existing Database?

I'm developing an ASP.NET MVC 4.5 project using EF 6 Code First to an Existing Database. I would like to create some new tables with foreign key relationships to one of the tables in the dbcontext I've created. I've altered and added columns in that original table, creating several migrations. There is real data in that table.
I would prefer to create the new tables in the database, but don't see how EF would generate a model for me. I can code the model myself, but don't see any documentation about how I would add it to the context class generated by EF. And then the migrations would be out of whack.
So I'm thinking that the best thing to do would be to delete all the migrations, delete the context class and drop the migrations table. Then I could start from scratch with an initial migration. Am I missing some gotcha? Is there a better way?
FWIW to others facing this dilemma, I figured it out. First I got rid of all the migrations, following the 100+ up-voted answer here: Reset Entity-Framework Migrations
Second, I created new the tables and constraints I needed in the database.
Third, I created a new entity in my solution and generated model classes from the database. I changed calls from the old entity to the new entity.The generator overwrote the model for the original table, but since I have all the annotations in version control, it is trivial to paste them in.
If I need to, I can enable migrations again.
Hope this helps.

How do I copy a view to multiple Notes databases?

We have a bunch of databases with similar designs. All of them have some design elements which inherit from various templates. Many of them have a specific view that needs that needs to be updated, but is not marked to inherit from a template.
While I know that I could remove the view from the databases, I'm not sure how I would add just that view from my template to each of the databases without doing it manually.
How would I copy a design element from one database to another programmatically?
I'm not sure why you cannot just mark also these views to inherit from template. Anyway Views are also notes and you should be able to copy a view this way:
lotus.domino.Database db = session.getCurrentDatabase();
db.getDocumentByUNID(db.getView("myview").getUniversalID()).copyToDatabase(dbTarget);
You can not copy the NotesView directly. But you can do it by DXLExporter and DXLImporter.
This is just complex and waste of time.
We have one alternate way for doing this. Instead of copying the view. We can copy the viewColumn and Create a new view in all other databases. Paste these column into it.
Set notesViewColumn = notesView.CopyColumn( sourceColumn [ , destinationIndex& ] )
I know that it does not answer exactly your questions but i wanted to suggest a Different approach.
You can have the view in the template and in all databases.
Then you could add an Option in a Profile to enable or disable the view.
In the outline you can hide or Display the view depending on the Profile setting.

Resources