FAQ Database Discussion Community


Solr 5.1.0: How to set the unique key via Schema API

solr,schema,unique-key
In Solr 5.1.0, is it possible to set the unique key via the REST schema api? I created a collection with the data driven schema. Solr would guess what the field type and create the field based on the data I upload. I can still define fields beforehand by sending...

MongoDB combine collections or have multiple references

mongodb,mongoose,schema,mongodb-query
I have a set of categories that a user can choose from (movies, music, books, etc) and rate items within the selected category. Because each category has different parameters (movies has year, music has artist, etc) I figured split up each category into it's own collection, however, that brings up...

How to write stored procedures using tables from another schema?

oracle,schema
Is it necessary that table should be in HR user to call function and procedure of Oracle? When I run function from another user, it gives me a compilation error. For my project,I want to run the function and procedure from another user. How can I implement it? ...

XML Schema not well-formed, what is my issue?

xml,xsd,schema
The error I'm getting when checking validity is: Not valid. Error - Line 8, 40: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 40; s4s-elt-invalid-content.1: The content of '#AnonType_xmtma' is invalid. Element 'element' is invalid, misplaced, or occurs too often.` The piece of code it's referring to is: <xs:element name="xmtma"> <xs:complexType> <xs:element ref="contact" />...

What is the purpose of specifying a schema in a web xml?

xml,selenium,selenium-webdriver,schema,dtd
Data Type Definition (DTD) and XML Schema Definition (XSD) - These are the two type of specifying a schema in a web xml. What is the purpose of a specifying this exactly? I have specified this in my TestNG.xml file like this <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > What is the...

mongoose schema set max length for a String [duplicate]

mongodb,mongoose,schema
This question already has an answer here: Mongoose expand default validation 2 answers I'm doing a schema with mongoose in Nodejs. And I'm trying to find a way to limit the number of character in a SchemaString. I found that it is possible to use a regex with the...

XML Namespace URI with HTTPS?

xml,xml-parsing,schema,uri,xml-namespaces
Is it better to have a xmlns URI with https protocol? For example this is the recommended way by the manual: <http xmlns="http://www.springframework.org/schema/security"/> Is it legal and better to use this way? <http xmlns="https://www.springframework.org/schema/security"/> Are there XML parsers that try to connect to an address defined by xmlns URI? Parsers...

SQL Schema recommendations

sql,sql-server,schema
I'm fairly new to SQL, especially in using it with PHP, and I'm currently working on an app that allows users to track their reading. The first version will have a simple calendar that allows you to input what day you start and when you should be finished by. My...

Generate XSD programmatically in java

java,parsing,xsd,schema,jsonschema
Is there any API to generate XSD programmatically in java. I need to generate XSD from Json-Schema ,I will read Json Schema and based on the elements i encounter during parsing need to create appropriate XSD elements. So if there is any API that can XSD elements it would help...

How can I allow only the dictionary keys “source”, “dest” and “keep” (see: config.json below) as dictionary keys in json schema?

python,json,dictionary,schema,jsonschema
How can I allow only the dictionary keys "source", "dest" and "keep" (see: config.json below) as dictionary keys in json schema? Using "required": ["snapshots"] together with "additionalProperties": False I managed to allow only the key "snapshots", but doing that analogous for the dictionary value of the key "string" ("required": ["source","dest",...

Meteor user has no email address

meteor,schema,meteor-accounts
Using simple schema and accounts-password. I'm trying to add in an initial account on start-up, but the email and password are not appearing. Schemas.User = new SimpleSchema({ username: { type: String, regEx: /^[a-z0-9A-Z_]{3,15}$/ }, emails: { type: [Object], optional: true }, "emails.$.address": { type: String, regEx: SimpleSchema.RegEx.Email }, "emails.$.verified": {...

Compare Array with Collection-Array containing Objects

node.js,mongodb,mongoose,schema
This is my collection schema: var objectSchema = new Schema({ members: [{ user_id: ObjectId, settings: { type: Boolean } }], title: String }); And now I'm trying to search for objects with specific members (identified by their "user_id", for example ["asdf123lkd", "asdf1223"]). Is there any way to search for these...

Save order data to local database

c#,sql,winforms,schema,storage
I am using C# to create a Windows form application. How do I create a local database table to save the data described below? Currently my data table consists of the columns of "inv_Id", "Item_Id" and "quantity". I know I need to create the columns to store each of the...

My schema for Meteor.users fails validation every time

javascript,meteor,schema,meteor-collection2
I'm using the collection2 package as seen here: https://github.com/aldeed/meteor-collection2 I've set up a simple schema wherein only email is a non-optional value, but despite this simpleness the validation fails every time claiming that "Email is required". My schema: Schema.UserProfile = new SimpleSchema({ firstName: { type: String, regEx: /^[a-zA-Z-]{2,25}$/, optional: true...

Rails: tools for auto-building existing project features/structure

ruby-on-rails,schema,structure
I need to create new version of my current project - take all features and rewrite it, add new features. What tools or gems do we have for Rails project to build for me some kind of catalogue of existing features? Maybe in form of models and associations between it...

Link_to Rails using Foreign and Primary Key

ruby-on-rails,schema
I have two tables: Events and Images Events: id name date location Images: id url (where it's hosted) caption event_id Events has many images but an image only has one event. Thus, an Event.id is connected to an Image.event_id. I want to create a page where an image is shown...

Join queries in Laravel

mysql,sql,laravel,join,schema
I'm having a lot of issues writing this query. Can someone please advise! Select all from bookings table where bookings.product_id = product.id then based on the return, i want to say if a field in the returned results (created_at) is greater than "7" then return 1 otherwise return 0....

Handle multiple tables of MySQL in with Solr 5.1.0?

java,php,schema,solrcloud,solr5
I have more than 30 tables in my MySQL database. Recently I have import data from my 1 table to Solr 5.1.0 using DataImporthandler and in my data-config.xml file, fire query of, select * from table-name But in my search I have to integrate more than 10 tables to give...

Schema in Pig after Flattening the String

schema,apache-pig,flatten
I am having the problem in implementing the field object ( schema) after flatting the string in pig. I have the following code: Data = load 'data/*.txt' using PigStorage( ) AS(...., date:chararray, .....); B = foreach Data FLATTEN(REGEX_EXTRACT_ALL(date, '"(.)/(.)/(.*) (.):(.):(.*)"')) AS (month:int, day:int, year:int, hour:int, min:int, second:int); --B = filter...

Can XSD extension re-order elements?

xml,xsd,schema
I want to extend a type in an XML Schema, say like this: <complexType name="alienInfo"> <complexContent> <extension base="personalInfo"> <sequence> <element name="planet" type="xsd:string"/> </sequence> </extension> </complexContent> </complexType> where <complexType name="personalInfo"> <sequence> <element name="name" type="xsd:string" /> <element name="age" type="xsd:int" /> </sequence> </complexType> But I want to change the order of the constituent...

XML Schema 1.0 “All” with multiple same elements?

xml,schema
What I want to validate is the XML looks like below: <A></A> <B></B> <C></C> <D></D> <E></E> <E></E> A,B,C,D just have zero or one. And they don't have sequence. It could be D,C,B,A. And in the very end, there are one or more E element(s). I have tried multiple ways, but...

Database Design Issue - Altering to accomodate new issue

database,postgresql,design,schema
Our problem is to design a database system that registers players at a club to play sports and play on teams registered to one sport. A player should be able to play a sport without being assigned to a team. I missed this important point by accident and now I...

Descriptive Hapi/Joi validation error

node.js,validation,schema,hapijs,joi
I've been trying to implement Joi in our node application (joi as standalone, not with hapi) and it seems to validate the schema properly but the error is always the same [ValidationError: value must be an object] name: 'ValidationError', details: [ { message: 'value must be an object', path: 'value',...

SQL embedded document equivalent

sql,mongodb,schema,schema-design
I'm starting to use SQL after only ever using mongodb. As such, I'm having trouble mapping some practices over to the SQL world. Primarily, I'm not sure how embedded documents in mongodb map to SQL. For example, in mongodb, if I wanted to model a person who has a car,...

jOOQ - add schema name to all tables

java,sql,schema,jooq
I'm using jOOQ 3.5.4 for code generation and query generation and an Azure SQL database. Is there a way to prepend the table name with the schema name in all queries (at runtime) or during the code generation process? I have only one schema currently (let's call it myschema) and...

Validate mixed-namespaced XML with XSD - why isn't this working?

xml,validation,xsd,schema
I have created two basic XML vocabularies: Address and Person. I have created an Address XSD schema (which doesn't have any dependencies on other schemas) - and this correctly validates an input address.xml doc. I have created a Person XSD schema which imports the Address XSD. My Person.xml (which is...

Laravel Schema for PostgreSQL Sequence

postgresql,laravel,schema,sequence
These are my requirements: I have a table(upload_training_files) The fields are id, organisation_id(foreign), year_id(foreign), created_by, created_at, updated_by, updated_at, file_path. The organisation_id field refers to id field of organisations. It should be auto_incremented and also should identify with a sequence table(upload_training_file_organisation_id_fk_seq). I have failed to do this in Laravel after repeated...

Merge 2 facts in cube?

schema,pentaho,olap-cube,mondrian
Is it possible to merge 2 facts tables to create a cube in a Mondrian schema example the case of sales and cost ?

“The element is missing..” trying to generate class with

c#,xsd,schema,xsd.exe
Using the XSD tool included with VS 2013, I receive the following message trying to generate a class from an xsd that contains <xsd:element ref=.../> - Schema validation warning: The 'http://www.w3.org/2000/09/xmldsig#:KeyName' element is not declared. Line 14, position 8. Warning: Schema could not be validated. Class generation may fail or...

SimpleSchema invalid keys with nested autoValue

meteor,schema
I have a schema like so (fluff cut out): Schemas.people = new SimpleSchema({ note: { type: [Schemas.notes], optional: true, defaultValue: [] }, updates: { type: [Schemas.updates], optional:true, autoValue:function(){ if (this.isInsert) { return [{ at: new Date, user_id: this.userId }]; } return { $push:{ at: new Date, user_id: this.userId } }...

Many to One Relation in Symfony 2

symfony2,doctrine2,mapping,schema,many-to-one
I have a problem related to Doctrine2: 1- I have two tables joining on a many-to-one relation: Table 1 - Activity The Schema: Backend\adminBundle\Entity\Activity: type: entity table: activity indexes: result_id: columns: - result_id id: id: type: integer nullable: false unsigned: false comment: '' id: true generator: strategy: IDENTITY fields: .........

AutoForm 5.0.2 nested schema inputs required on update

validation,meteor,nested,schema,meteor-autoform
I have schemas set up so that I can have an array of complex input sets. Something like: address = { street:{ type: String }, city: { type: String }, active_address: { type: Boolean, optional: true }, ... } people: { name:{ type: String }, address:{ type: [address], optional: true,...

Git Repository And Database Schemas

mysql,git,schema
My company use Git for “version control”,etc. Currently it is used for C, C# and Python. I have been asked to add the database schemas together with the more “complex” SQL (no idea when it becomes “complex”) to the repository. Currently the database is backed up after changes have been...

how to ensure the value of an attribute in the set of values of another attribute?

xml,xsd,schema
This is a parameters configure. <params> <param name="use-schema" /> <param name="schema-domain" relyon="use-schema" /> <param name="schema-file" relyon="use-schema" /> </params> And this is part of XSD content. <xs:element name="param"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="relyon" type="xs:string" /> </xs:complexType> </xs:element> I wrote some basic xsd, but there's no restriction for relyon, how...

Apache Spark: get elements of Row by name

scala,apache-spark,schema,dataframes
In a DataFrame object in Apache Spark (I'm using the Scala interface), if I'm iterating over its Row objects, is there any way to extract values by name? I can see how to do some really awkward stuff: def foo(r: Row) = { val ix = (0 until r.schema.length).map( i...

Map an XML list into a Word repeating component (Word 2013)

xml,excel,ms-word,schema,repeat
I have an xml file that I have generated from an excel spreadsheet. This xml represents the rows and columns of the spreadsheet. For instance: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <data-set xmlns="dummy.xsd"> <record> <LastName>Smith</LastName> <Sales>16753</Sales> <Country>UK</Country> <Quarter>Qtr 3</Quarter> </record> <record> <LastName>Johnson</LastName> <Sales>14808</Sales> <Country>USA</Country>...

Parse XSD restrictions

c#,xml,visual-studio,xsd,schema
<xs:group name="datosGeneralesComunes"> <xs:sequence> <xs:element name="gravedad"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="1" /> <xs:maxInclusive value="4" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="zona"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="1" /> <xs:maxInclusive value="4" /> </xs:restriction> </xs:simpleType>...

Activity streams / feeds / news in social network database schema

sql,database,stream,schema,social-networking
I have a goal to implement database schema for simple \ typical social network. I have read many threads \ answers but have couple open questions. So we have User table (userId, name and etc). We can make some Actions (reply, like, follow and etc). I want to implement some...

How to differentiate elements in an XSD by namespaces

xml,xsd,namespaces,schema
Given the following XML snippet: ... <ns1:Method> <Parameter1 /> <Parameter2 /> </ns1:Method> <ns2:Method> <Parameter3 /> </ns2:Method> ... Is it possible to write an XML Schema definition, that differs the complexType of Method by its namespace, so that multiple different types named Method are possible? In this example the Method element...

Determine if a Database is “Equal” to a DacPackage

c#,sql-server,sql-server-2012,schema,dac
Is there a way to use the SQL Server 2012 Microsoft.SqlServer.Dac Namespace to determine if a database has an identical schema to that described by a DacPackage object? I've looked at the API docs for DacPackage as well as DacServices, but not having any luck; am I missing something?

How to manage versions of Data Model Schema versions

ios,core-data,schema,datamodel
I am having an app on app store. I have to update model version after every 2 months on average due to updates. I have 7 versions right now and they will definitely increase in future. I have some questions: How I can efficiently manage this Can I delete my...

Creating fact table with year of 9999

oracle,data,schema,star-schema,warehouse
I'm building a simple fact table in oracle based on a customer status where a customer has a status, 'Active' and 'Lost' and a date they started with that status and a date they ended. A sample 3 rows would be; CustID | status | date_start | date_end --------------------------------------- 1...

How to structure this relational database

mysql,sql,schema,erd
Basically I'll be having 3 tables that have relation. They are: users, departments and company. The issue I have is this: A company can have many departments A department can only be attached to one company A user can only be part of one company A user can be part...

sqlite schema has quotes around table name after a table rename

sqlite,schema
I had to rename an existing table in my sqlite database using the following command: ALTER TABLE users RENAME TO widgets; After running that command, when I check the schemas using the .schema command, this is what I see: CREATE TABLE "widgets"(id integer primary key AUTOINCREMENT, widget_tag varchar(10), destination varchar(100),...

How to create a schema of an xml object in php?

php,xml,schema
I have an xml object and need to create a schema to it so when I give it to anybody they will know how the xml I'm sending look like

Existing SOLR collection not picking up Zookeeper schema change

solr,schema,config,zookeeper,solrcloud
I have a local solr cloud cluster running on three separate nodes: 33.33.3[3-5]:8080 This cluster is managed by a local 3 node zookeeper ensemble that lives at: 33.33.3[0-2]:2181 I am trying to experiment with schema modifications - however, I'm having trouble getting SOLR to pickup the new changes. Here is...

How to get maxInclusive value from a schema element in java using apache.xcerces?

java,schema,xerces
I have schemas with elements restrictions use to validate GUI forms. I want to get the value restrictions of some predefined elements, to provide them as tooltip on the forms. The schema is loaded in org.apache.xerces.parsers.DOMParser which does the validation, I would think that there is a series of methods...

Is there a built-in function to get all unique values in an array field, across all records?

arrays,node.js,mongodb,mongoose,schema
My schema looks like this: var ArticleSchema = new Schema({ ... category: [{ type: String, default: ['general'] }], ... }); I want to parse through all records and find all unique values for this field across all records. This will be sent to the front-end via being called by service...

Schema addition in slapd.d : unknown directive

ldap,schema,openldap
I am trying to set up an openLDAP LDAP on Ubuntu 14.04, and I would like to add a custom schema to the dynamic ldap conf. As I understood, I have to add dynamically a ldif entry to my ldap, under the DN: cn=myCustomSchema,cn=schema,cn=config. What I wanted to do was:...

Element 'foo': This element is not expected. Expected is ( {http://www.example.com}foo )

php,xml,validation,schema,domdocument
When trying to validate a PHP DOMDocument object against a schema by using schemaValidate method, the next warning is being generated: Warning: DOMDocument::schemaValidate(): Element 'foo': This element is not expected. Expected is ( {http://www.example.com}foo ). in X on line Y It only happens with elements that have been appended to...

How to exclude DB connection settings from a SCMP?

sql-server,visual-studio,version-control,schema
We have a solution we use to update our database, which includes several "schema comparison" (.scmp) files. These files provide a convenient way to quickly open a tab that compares the schema of the project with the DB's schema. The trouble is, the DB connection string is embedded in the...

xsd restrict children to children of another complexType

xml,validation,xsd,schema
Is it possible to restrict the children of an complexType to exist in the children of another complexType. for example <xs:element name="people"> <xs:complexType> <xs:sequence> <xs:element name="person" type="personType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="companies"> <xs:complexType> <xs:sequence> <xs:element name="company" type="companyType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType>...

Should I use separate collection or embed fields that I know won't be used for all models. MongoDB

mongodb,database-design,mongoose,schema
Background: I'm planning an app that will have 3 types of posts, for n number of games; Single-posts, team-posts, coach-posts. Now I'm not sure of the best Schema for a single type of post. The posts of a certain type share a couple fundamental attributes, like: user_id, comments, status, etc....

How do I model multiple “many to many” relationships in Cassandra?

cassandra,nosql,schema
I've been reading up on Cassandra, I've done some tutorials and played around with CQL but now that it is time for me to design a schema I'm having some difficulty. I'm trying to create a schema that will handle the following use case. I need to keep track of...

No Synchronize Model with Database in Mysql Workbench

mysql,synchronization,schema,mysql-workbench,sync
I'd like to synchronize a model in Mysql workbench. However, I can't find the wizard following these steps in the docs. How do I enable this feature? I'm running 6.3.3.0 (latest) on Mac Os X . ...

How to get a JSON representation of a Mongoose schema?

json,mongodb,mongoose,schema
I'm writing an API in Express, using Mongoose as my data layer. I'd like the API to be as self-describing as possible so my frontend can automatically generate forms and validation based on schema rules set up in my Mongoose models. Is there any existing way to get a JSON...

Validating JSON input with a JSON schema

json,validation,schema,jsonschema,json-schema-validator
If you specify elements in the input file that is configured as a requirement in the schema, it is validating OK. And if you append the “maxItems”: 1, it does not care if you add another element in the input file, the validator still look at this as a valid...

Moving records to another table vs. “flag” column SQL performance

sql,database,performance,indexing,schema
Suppose I have a table that represents "task queue" (tens of millions of records). Tasks can be "queued" or "done". Which performs better if we want to grab 10 task to process? Single table with "flag" column like ENUM / BIT / TINYINT flagging task as done or not (eventually...

How to make 'Schema Compare' of Database->SQL Project respect SQL-CMD Variables

sql,visual-studio-2013,schema,database-project,schema-compare
I have a Visual Studio 2013 solution with 2 SQL Projects DB1, DB2. DB1 has a stored procedure that references DB2. If I use a .dacpac and synonyms in procedures SELECT * FROM [$(DB2)].[dbo].[Table1] then Compare Schema from Database to the SQL Project wrongly detects the above as a change...

Laravel 5 Migration, Invalid default value when integer

php,migration,schema,laravel-5,builder
I was trying to create an table having a 0 as its default integer value The code looks like: Schema::create('gsd_proyecto', function($table) { $table->increments('id'); $table->string('nombre', 80)->unique(); $table->string('descripcion', 250)->nullable(); $table->date('fechaInicio')->nullable(); $table->date('fechaFin')->nullable(); $table->integer('estado', 1)->default(0); $table->string('ultimoModifico', 35)->nullable(); $table->timestamps(); }); But when I run the migration I'm getting the...