database-schema

Way to obscure SQL Server database schema?

社会主义新天地 提交于 2019-12-11 05:09:01
问题 Is there any way to obscure the schema of a database on SQL Server? If I have SQL Server Express installed on a client site, is there a way to obscure the schema and data so that someone else cannot come along and learn the schema in order to extract data out of it and into another product? 回答1: This is a tricky one and may not even be 100% possible. However, there are a few tricks to setting it up: Install a new named instance of SQL server with a custom SA account (both name and password).

Mongoose throws `Field is not in schema` error when defining a field twice

旧街凉风 提交于 2019-12-11 04:07:43
问题 I am using Node v0.10.31 and mongoose@3.8.22. I think I have encountered a bug that appears when specific things happen. The implications of this bug prevents me from having a field "name" and "father.name.full" on the same schema. This is how I define my schema: 'use strict'; var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/myapp'); var PersonSchema = new mongoose.Schema({ name: { type: mongoose.Schema.Types.ObjectId, ref: 'Name', // if this is commented out, no

How do I add a column to a table (schema upgrade) and have it map to an EF code first object

大兔子大兔子 提交于 2019-12-11 02:54:28
问题 I have a database that I created for a site using Entity Framework 4.1 code first. I need to add a simple property to one of my entity classes, and add a corresponding (possibly nullable) column to the database without losing any of the data in the database. I think I can take down the site, alter the database to add the column, and redeploy website with an updated entity class, but I'm not sure that's the best way to do this schema upgrade. Is there a standard (or just better) way of doing a

How to create custom schema with Corda Vault Extension

无人久伴 提交于 2019-12-11 02:51:35
问题 From Corda documents, it says we can have custom schema in Vault Extension. However there is not much clarity for Vault Extension which should have ability to create/manage custom database schema pertaining to node vault database. Are we going to publish API in feature release of Corda 回答1: Inside flows, the node exposes a JDBC connection that allows you to write native custom SQL queries (as a vault extension). You can access this JDBC connection using serviceHub.jdbcSession() . If your

At what point in a Web API app can I intercept the URI arguments and route the calls accordingly?

时间秒杀一切 提交于 2019-12-11 02:27:28
问题 Note: This question is indeed somewhat similar to this one, but I think I can put it in a simpler and more specific way. I'm using Castle Windsor to intercept the URI passed to my Web API app to register the appropriate concrete class to the Controller's constructor. What I want to be able to do is pass a "site number" on the URI, perhaps always as either the first or last arg. IOW, for site 42, instead of http://localhost:28642/api/platypi/GetAll ...it would be: http://localhost:28642/api

How to upgrade MySQL database schema?

回眸只為那壹抹淺笑 提交于 2019-12-11 00:26:12
问题 How to upgrade a production DB schema from a dev DB schema automatically, via command line? The dev version has changes to the schema that need to be made in the production schema, but I cannot lose the data in production. 回答1: Schema Migrations Most modern projects use a tool to track each individual change to the database, and associate some version number with the change. The database must also have some table to store its current version. That way the tool can query the current version

Migration scripts for Structure and Data

不羁岁月 提交于 2019-12-10 22:44:10
问题 Is there a good or recommended tool that manages both DDLs and DMLs migrations? Majority of my App configuration is stored in a database, I want to be able to freely develop and migrate this and not only the DDLs. Any suggestions on this? 回答1: Both Flyway and Liquibase can deal with DML. Speaking from the Flyway perspective, Flyway has been built from the ground up with both DDL and DML (configuration, reference data, ...) in mind. The whole range of DML commands can be used as migrations are

DB Schema for Dynamic Categories

£可爱£侵袭症+ 提交于 2019-12-10 16:45:38
问题 Added Update #1 . Please check at the end of the question. Thanks. Friends, I am designing a Product Listing with categories and filters tied to the categories. I currently have a database schema with static categories. I have to make them dynamic. I couldn't find out the right schema to make it dynamic, so I hard code the schema in the form. My detailed work is as follows. MySQL Stuff The main products table is the index of all the products and each category of products have separate fields.

How to retrieve column default value from MS SQL data table

☆樱花仙子☆ 提交于 2019-12-10 16:39:49
问题 I am using DataAdapter.FillSchema to retrieve tables' schema from MS SQL. Unfortunately this doesn't return the default value for the columns. Is there a way to retrieve this value as part of the schema in a fast and efficient way as I need to examine hundreds of tables? Thanks! 回答1: Default value is determined at the time of row insertion only. As an alternative, you can utilize Information_schema SELECT TABLE_NAME, COLUMN_NAME, COLUMN_DEFAULT FROM AdventureWorks2012.INFORMATION_SCHEMA

How can I find all columns that are filled with 100% nulls in my SQL Server database schema?

妖精的绣舞 提交于 2019-12-10 13:19:16
问题 Is there a SQL way to find out which columns in my schema are completely full of null values? There are some fields in a couple of tables that I know are not used by the application and will be dropped, but I wanted to see if there was an automated way/script to find this out across the whole database to find candidates for code review/possible removal. Running SQL Server 2005 on x86 if it matters. Thanks in advance! 回答1: create table #SuspectColumns ( TABLE_SCHEMA sysname, TABLE_NAME sysname